How to configure Blazor with Windows Authentication and IIS - iis

I'm having issues with my Blazor app and Windows Authentication after getting IIS hooked up to it. I've been through the steps in this guide however, everytime I go to the site, I get a chrome dialog asking me for a username and a password. My understanding is that IIS should be handling my windows creds and forwarding it to the site.
Expected result:
Actual result:
I see that IISExpress will run the website as my local domain user, which works just fine and the app lets me in. When I run the site from IIS (when it uses the apppool user) is what I run into issues. I need to be able to authenticate as my user without changing the user that the Apppool runs as.
Some information of the project
launchSettings.json:
{
"iisSettings": {
"windowsAuthentication": true,
"anonymousAuthentication": false,
"iis": {
"applicationUrl": "https://customersupport.dev.local",
"sslPort": 0
},
"iisExpress": {
"applicationUrl": "http://localhost:13394",
"sslPort": 44318
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Shelby.CustomerSupport": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": "true",
"applicationUrl": "https://localhost:5001;http://localhost:5000"
},
"IIS": {
"commandName": "IIS"
}
}
}
web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="false" />
<windowsAuthentication enabled="true" />
</authentication>
</security>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="bin\Debug\net5.0\Shelby.CustomerSupport.exe" arguments="" stdoutLogEnabled="false" hostingModel="InProcess">
<environmentVariables>
<environmentVariable name="ASPNETCORE_HTTPS_PORT" value="443" />
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" />
</environmentVariables>
</aspNetCore>
</system.webServer>
</location>
</configuration>
What am I missing here?

Related

Getting error ( POST 500 Internal Server Error) when running Full-Stack Web application in Azure

I have developed a full-stack application with Vue 2, Node , Express and Postgres.
I could deploy the application to Azure , and the system coming up, but when I try to do register user with Register page that I have created , I get " POST … 500 (Internal Server Error) ", **as I have tried with Postman , there is no issue in saving user data with same post controller ** .
Notice that I have set BaseURL to ‘’ in Api.js ( Client ):
import axios from ‘axios’
import store from ‘#/store/store’
export default () => {
return axios.create({
baseURL: ‘’,
headers: {
Authorization: Bearer ${store.state.token}
}
})
}
this is Register controller in /Controller folder :
//Registering user
async register(req, res) {
const hash = bcrypt.hashSync(req.body.password, 10);
try {
const user = await User.create(
Object.assign(req.body, { password: hash })
);
const userJson = user.toJSON();
res.send({
user: userJson,
token: jwtSignUser(userJson),
});
} catch (err) {
res.status(500).send({
error: There is error in registering: ${err},
});
}
},
I have added the following web.config file in dist folder, but it doesn't resolve the issue :
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension="woff" mimeType="application/font-woff" />
<mimeMap fileExtension="woff2" mimeType="application/font-woff" />
</staticContent>
<rewrite>
<rules>
<clear />
<rule name="Redirect to https" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
</rule>
</rules>
</rewrite>
<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<remove statusCode="500" subStatusCode="-1" />
<error statusCode="404" path="/survey/notfound" responseMode="ExecuteURL" />
<error statusCode="500" path="/survey/error" responseMode="ExecuteURL" />
</httpErrors>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
Could you please let me know how I could resolve the issue .

"The remote name could not be resolved" when running an Azure DevOps self-hosted build agent in Service Fabric

I can successfully start a self-hosted agent on my Windows 10 machine following this article:
https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops#windows
However when I try to start the very same Docker image in Service Fabric with Windows Server 20H2 nodes, I get these container log entries:
1. Determining matching Azure Pipelines agent...
Invoke-RestMethod : The remote name could not be resolved: 'dev.azure.com'
At C:\azp\start.ps1:34 char:12
+ $package = Invoke-RestMethod -Headers #{Authorization=("Basic $base64 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:Htt
pWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShe
ll.Commands.InvokeRestMethodCommand
Dockerfile
FROM mcr.microsoft.com/windows/servercore:20H2
WORKDIR /azp
COPY start.ps1 .
CMD powershell .\start.ps1
ApplicationManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest ApplicationTypeName="build-agent-20H2" ApplicationTypeVersion="20201228.5"
xmlns="http://schemas.microsoft.com/2011/01/fabric"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="Package" ServiceManifestVersion="20201228.5" />
<EnvironmentOverrides CodePackageRef="buildagent.Code">
<EnvironmentVariable Name="AZP_URL" Value="https://dev.azure.com/myaccount" />
<EnvironmentVariable Name="AZP_TOKEN" Value="mypat" />
<EnvironmentVariable Name="AZP_AGENT_NAME" Value="myagentname" />
<EnvironmentVariable Name="AZP_POOL" Value="mypoolname" />
</EnvironmentOverrides>
<Policies>
<ServicePackageResourceGovernancePolicy CpuCores="1"/>
<ResourceGovernancePolicy CodePackageRef="buildagent.Code" MemoryInMB="1024" />
<ContainerHostPolicies CodePackageRef="buildagent.Code" UseTokenAuthenticationCredentials="true">
<HealthConfig IncludeDockerHealthStatusInSystemHealthReport="true" RestartContainerOnUnhealthyDockerHealthStatus="false" TreatContainerUnhealthyStatusAsError="false" />
</ContainerHostPolicies>
</Policies>
</ServiceManifestImport>
<DefaultServices>
<Service Name="buildagent">
<StatelessService ServiceTypeName="buildagentType" InstanceCount="1">
<SingletonPartition />
</StatelessService>
</Service>
</DefaultServices>
</ApplicationManifest>
ServiceManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="Package" Version="20201228.5"
xmlns="http://schemas.microsoft.com/2011/01/fabric">
<ServiceTypes>
<StatelessServiceType ServiceTypeName="buildagentType" UseImplicitHost="true">
</StatelessServiceType>
</ServiceTypes>
<CodePackage Name="buildagent.Code" Version="20201228.5">
<EntryPoint>
<ContainerHost>
<ImageName>myacr.azurecr.io/build-agent-20h2:20201228.5</ImageName>
<Commands>
</Commands>
</ContainerHost>
</EntryPoint>
<EnvironmentVariables>
<EnvironmentVariable Name="AZP_URL" Value="" />
<EnvironmentVariable Name="AZP_TOKEN" Value="" />
<EnvironmentVariable Name="AZP_AGENT_NAME" Value="" />
<EnvironmentVariable Name="AZP_POOL" Value="" />
</EnvironmentVariables>
</CodePackage>
</ServiceManifest>
I also tried without these specs:
ServicePackageResourceGovernancePolicy
ResourceGovernancePolicy
HealthConfig
and I wonder whether I can bring up a container in Service Fabric without having a HTTP or TCP endpoint.
EDIT:
another observation: When I SSH/remote onto one of the nodes where I deployed the image to and docker run -it the image directly, the remote name can be resolved and the installation procedure works (?). So it seams SF starts the container differently.
EDIT 2:
Tried with a simplified start.ps1
Invoke-WebRequest -OutFile dotnet.zip https://dotnetcli.blob.core.windows.net/dotnet/Sdk/2.2.402/dotnet-sdk-2.2.402-win-x64.zip
Read-Host
brings same error. Comparing docker inspect on SF controlled container and directly started container I see a deviation which maybe relevant:
SF (not working)
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
...
"Networks": {
"nat": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "b52a59a54d97f56f8fc866c0f742588023333ff1cb10b2c536be21d6745d609d",
"EndpointID": "bc20ebb2124467f5135aefeefd7e3d38c14338479f7a5dbd04fd274dd0fa3ddf",
"Gateway": "192.168.80.1",
"IPAddress": "192.168.81.196",
"IPPrefixLen": 24,
direct (working)
"Dns": [
"10.1.0.211"
],
"DnsOptions": [
"ndots:1"
],
"DnsSearch": [
"build-agent-20H2"
],
...
"Networks": {
"nat": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "b52a59a54d97f56f8fc866c0f742588023333ff1cb10b2c536be21d6745d609d",
"EndpointID": "",
"Gateway": "",
"IPAddress": "",
"IPPrefixLen": 0,
When deploying the same image with compose deployment network resolution was working fine and build agent installed & started successfully.
Comparing manifests I added endpoints and it was working:
ApplicationManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest ApplicationTypeName="build-agent-20H2" ApplicationTypeVersion="20201228.5"
xmlns="http://schemas.microsoft.com/2011/01/fabric"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="Package" ServiceManifestVersion="20201228.5" />
<EnvironmentOverrides CodePackageRef="buildagent.Code">
<EnvironmentVariable Name="AZP_URL" Value="https://dev.azure.com/myaccount" />
<EnvironmentVariable Name="AZP_TOKEN" Value="mypat" />
<EnvironmentVariable Name="AZP_AGENT_NAME" Value="myagentname" />
<EnvironmentVariable Name="AZP_POOL" Value="mypoolname" />
</EnvironmentOverrides>
<Policies>
<ServicePackageResourceGovernancePolicy CpuCores="1"/>
<ResourceGovernancePolicy CodePackageRef="buildagent.Code" MemoryInMB="1024" />
<ContainerHostPolicies CodePackageRef="buildagent.Code" UseTokenAuthenticationCredentials="true">
<PortBinding ContainerPort="80" EndpointRef="agentEndpoint" />
<PortBinding ContainerPort="443" EndpointRef="agentEndpoint1" />
</ContainerHostPolicies>
</Policies>
</ServiceManifestImport>
<DefaultServices>
<Service Name="buildagent">
<StatelessService ServiceTypeName="buildagentType" InstanceCount="1">
<SingletonPartition />
</StatelessService>
</Service>
</DefaultServices>
</ApplicationManifest>
ServiceManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="Package" Version="20201228.5"
xmlns="http://schemas.microsoft.com/2011/01/fabric">
<ServiceTypes>
<StatelessServiceType ServiceTypeName="buildagentType" UseImplicitHost="true">
</StatelessServiceType>
</ServiceTypes>
<CodePackage Name="buildagent.Code" Version="20201228.5">
<EntryPoint>
<ContainerHost>
<ImageName>myacr.azurecr.io/build-agent-20h2:20201228.5</ImageName>
<Commands>
</Commands>
</ContainerHost>
</EntryPoint>
<EnvironmentVariables>
<EnvironmentVariable Name="AZP_URL" Value="" />
<EnvironmentVariable Name="AZP_TOKEN" Value="" />
<EnvironmentVariable Name="AZP_AGENT_NAME" Value="" />
<EnvironmentVariable Name="AZP_POOL" Value="" />
</EnvironmentVariables>
</CodePackage>
<Resources>
<Endpoints>
<Endpoint Name="agentEndpoint" UriScheme="http" />
<Endpoint Name="agentEndpoint1" UriScheme="https" />
</Endpoints>
</Resources>
</ServiceManifest>

You do not have permission to view this directory or page for Azure Ionic App

My Ionic2 Node.js app run locally and I pushed it successfully to azure with GitBash.
When browsing it is showing:
"You do not have permission to view this directory or page."
I did add
web.config, process.json, index.js,
"start": "node index.js"
in package.json and 'azure mobile service' plugin.
No progress. Can someone please assist? Thanks...
Web.Config:
<configuration>
<system.webServer>
<handlers>
<add name="iisnode" path="index.js" verb="*" modules="iisnode"/>
</handlers>
<rewrite>
<rules>
<rule name="SPA">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
process.json:
{
"name": "worker",
"script": "./index.js",
"instances": 1,
"merge_logs": true,
"log_date_format": "YYYY-MM-DD HH:mm Z",
"watch": true,
"watch_options": {
"followSymlinks": true,
"usePolling": true,
"interval": 5
}
}
package.json:
{
"name": "io.cordova.myappd3d469",
"author": "",
"homepage": "",
"private": true,
"scripts": {
"start": "node index.js",
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve",
"watch": "ionic-app-scripts watch"
},
"dependencies": {
"#angular/common": "2.2.1",
"#angular/compiler": "2.2.1",
"#angular/compiler-cli": "2.2.1",
"#angular/core": "2.2.1",
"#angular/forms": "2.2.1",
"#angular/http": "2.2.1",
"#angular/platform-browser": "2.2.1",
"#angular/platform-browser-dynamic": "2.2.1",
"#angular/platform-server": "2.2.1",
"#ionic/storage": "1.1.7",
"ionic-angular": "2.0.1",
"ionic-native": "2.4.1",
"ionicons": "3.0.0",
"rxjs": "5.0.0-beta.12",
"sw-toolbox": "3.4.0",
"zone.js": "0.6.26"
},
"devDependencies": {
"#ionic/app-scripts": "1.1.0",
"typescript": "2.0.9"
},
"description": "Ionic2Blank: An Ionic project",
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-statusbar",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [],
"-vs-binding": {
"BeforeBuild": [ "ionic:build" ]
}
}
index.js:
var http = require('http');
var server = http.createServer(function (request, response) {
response.writeHead(200, { "Content-Type": "text/plain" });
response.end("Hello World!");
});
var port = process.env.PORT || 1337;
server.listen(port);
console.log("Server running at http://localhost:%d", port);
Azure web app settings:
You can use the following web.config instead:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.webServer>
<handlers>
<add name="iisnode" path="index.js" verb="*" modules="iisnode" />
</handlers>
<rewrite>
<rules>
<!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
<rule name="StaticContent">
<action type="Rewrite" url="public{REQUEST_URI}" />
</rule>
<!-- All other URLs are mapped to the node.js site entry point -->
<rule name="DynamicContent">
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
<action type="Rewrite" url="index.js" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

Enable GZip compression for SVG in Azure Web Sites?

I'm trying to enable GZip compress for SVG in an Azure Web Site using web.config transforms without success. Here is what my transform looks like:
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.webServer>
<httpCompression>
<staticTypes>
<add mimeType="image/svg+xml" enabled="true" xdt:Transform="Insert" />
</staticTypes>
</httpCompression>
<staticContent xdt:Transform="Insert">
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
</staticContent>
</system.webServer>
</configuration>
This should both add the mime type for SVG, which Azure doesn't seem to have, and then enable compression. I've verified the mime type addition works fine, but upon publishing I get an error for the compression elements:
No element in the source document matches
'/configuration/system.webServer/httpCompression/staticTypes'
Removing the compression from the transform and adding it directly to my web.config file removes the error, but I still don't see the compression in the HTTP headers. Here are the response headers:
Accept-Ranges:bytes
Content-Length:23265
Content-Type:image/svg+xml
Date:Mon, 10 Jun 2013 17:19:37 GMT
ETag:"c4e9ec93d765ce1:0"
Last-Modified:Mon, 10 Jun 2013 12:39:41 GMT
Server:Microsoft-IIS/8.0
X-Powered-By:ASP.NET
X-Powered-By:ARR/2.5
X-Powered-By:ASP.NET
Here is how you can enable it in your web.config:
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
</staticContent>
<httpCompression>
<staticTypes>
<remove mimeType="*/*" />
<add mimeType="image/svg+xml" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
</httpCompression>
</system.webServer>
</configuration>
The key line is the removal of the catch-all (and later re-add). If you don't have that, then the svg line basically gets ignored since the catch-all is inherited from applicationhost.config, and catches all before it reaches svg line.
Unfortunately it isn't possible to use built-in http compression on Azure Websites for image/xml+svg mime types. You have to change some IIS settings to do that which is possible if you're using Azure Web Roles.
I didn't want to go through that hassle however so I just made a controller in MVC to handle .svg files.
[AttributeRouting.RoutePrefix("static")]
public class ContentController : Controller
{
[GET(#"fonts/{fileName:regex(^[\w-\.]+\.svg$)}")]
[Compress, OutputCache(
Duration = 3600 * 24 * 30,
Location = OutputCacheLocation.Any,
VaryByContentEncoding = "gzip;deflate",
VaryByParam = "fileName")]
public ActionResult SvgFont(string fileName)
{
var path = Server.MapPath("~/Content/fonts/" + fileName);
if (!System.IO.File.Exists(path)) return HttpNotFound();
return File(path, "image/svg+xml");
}
}
public class CompressAttribute : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
filterContext.HttpContext.CompressResult();
}
}
public static class HttpContextExtensions
{
public static bool CompressResult(this HttpContextBase context)
{
var request = context.Request;
var response = context.Response;
if (request == null || response == null) return false;
var filter = response.Filter;
if (filter is GZipStream || filter is DeflateStream) return false;
var acceptEncoding = (request.Headers["Accept-Encoding"] ?? string.Empty).ToLowerInvariant();
if (acceptEncoding.Contains("gzip"))
{
response.Filter = new GZipStream(filter, CompressionMode.Compress);
response.AddHeader("Content-Encoding", "gzip");
response.AppendHeader("Vary", "Content-Encoding");
return true;
}
if (acceptEncoding.Contains("deflate"))
{
response.Filter = new DeflateStream(filter, CompressionMode.Compress);
response.AddHeader("Content-Encoding", "deflate");
response.AppendHeader("Vary", "Content-Encoding");
return true;
}
return false;
}
}
You will also need to add this to your Web.config file so that MVC will handle routes with a .svg extension
<system.webServer>
<handlers>
<add name="StaticMvcHandler" path="static/fonts/*.svg" verb="GET" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
I have the following configuration entries for an Azure Web-Site:
<system.webServer>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
</system.webServer>
and
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<!-- Scalable Vector Graphics iPhone, iPad -->
<mimeMap fileExtension=".svgz" mimeType="image/svg+xml" />
I have added the .svgz extension as well (for compressed svg).
The above solution worked for me but I first had to remove the file extension. After that I got the results I was looking for.
<staticContent>
<remove fileExtension=".svg" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
</staticContent>

WebAPI DELETE request return 404 error in Azure

I have been trying to get the DELETE requests in my ASP.net WebAPI(ASP.net web role) working on Azure and locally on my machine.But end up getting "not found" error.
I have following configuration for the web.config of the ASP.net WebAPI web role:
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<remove name="WebDAVModule" />
</modules>
<handlers>
<remove name="WebDAV" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit"
path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS"
modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll"
preCondition="classicMode,runtimeVersionv4.0,bitness32"
responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit"
path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS"
modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll"
preCondition="classicMode,runtimeVersionv4.0,bitness64"
responseBufferLimit="0" />
<add name="ExtensionlessUrlHandler-Integrated-4.0"
path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS"
type="System.Web.Handlers.TransferRequestHandler"
preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
</system.webServer>
For making it work on IISExpress, I changed the $:\Users\\Documents\IISExpress\config\applicationhost.config configuration and commented out the WebDav portions of it and added the "PUT,DELETE" verbs appropriately.
To test my WebAPI I created a simple windows forms (.net 4.5 ) c# application and used the httpclient as below:
const string key = "user1";
var client = new HttpClient { BaseAddress = new Uri("http://abcd.cloudapp.net/") };
client.DefaultRequestHeaders.Accept.Add(
new MediaTypeWithQualityHeaderValue("application/json"));
var requestUrl = string.Format("api/user/{0}", key);
var deleteAsync = client.DeleteAsync(requestUrl).Result;
The response I get it following:
{StatusCode: 404,
ReasonPhrase: 'Not Found',
Version: 1.1,
Content: System.Net.Http.StreamContent,
Headers:
{
Pragma: no-cache
Cache-Control: no-cache
Date: Fri, 12 Apr 2013 06:40:31 GMT
Server: Microsoft-IIS/8.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Content-Length: 128
Content-Type: application/json; charset=utf-8
Expires: -1
}} System.Net.Http.HttpResponseMessage
How do I get it to work on Azure? and possibly on my local machine as well.

Resources