# Microsoft Azure

Microsoft Azure supports different deployment types for Wisej (ASP.NET) applications. You can deploy to a Web Site (renamed to Web Service), to an IIS instance or a to a Virtual Machine with IIS.

In all cases you can publish directly from Visual Studio. Please refer to the [Visual Studio Publishing](/deployment/concepts/visual-studio-publishing.md) guide and to Microsoft's Azure Deployment documentation for ASP.NET.

{% embed url="<https://youtu.be/sM6sjSlzwCE>" %}

{% embed url="<https://docs.microsoft.com/en-us/azure/app-service/quickstart-dotnetcore?pivots=development-environment-vs&tabs=netcore31>" %}

## Project Formats

### Old Project Format

#### Supported Frameworks for Publishing

* .NET Framework v4.x

### SDK-Project Format

#### Supported Frameworks for Publishing

* .NET Core

{% hint style="warning" %}
You cannot publish .NET Framework v4.x projects to Azure using the Visual Studio Publishing Tool with the new SDK-Project format.
{% endhint %}

## Troubleshooting&#x20;

### .NET Core

**The application was published successfully but shows an error 'Couldn't find Wisej.Framework' on startup.**

Remove `<add name="Wisej" type="Wisej.Core.HttpModule, Wisej.Framework" />` from `<modules>` in **web.config**.

#### The application was published successfully but shows a blank white screen on startup.

Make sure `<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />` is uncommented under \<handlers> in **web.config**.&#x20;

## Security

When deploying on .NET Core, you are unable to use the `web.config` file to configure the `System.Web.HttpForbiddenHandler`, which is typically used to block the downloading of potentially sensitive `.json` files. As a result, these `.json` files could become accessible for downloading, which might pose a security vulnerability.

Since ASP.NET Core relies on middleware modules instead of using traditional HttpHandlers and HttpModules, to secure specific files or directories, you need to modify the configuration in the `Startup.cs` file. Adjusting the middleware settings within `Startup.cs` allows you to implement security measures to protect sensitive files or directories effectively.

Below is an example of how to block access to specific files or directories in ASP.NET Core, based on your security requirements. You can customize the middleware configuration in the `Startup.cs` file to meet your particular security needs.

{% code title="Conditional UseFileServer" %}

```csharp
// app.UseFileServer();
app.UseWhen(
 cx => !cx.Request.Path.Value.EndsWith(".json", StringComparison.OrdinalIgnoreCase), 
 app => app.UseFileServer()
);
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/deployment/targets/microsoft-azure.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
