Azure Url Configuration and Customization Best Practices

Author

Reads 1.3K

A breathtaking view of sailboats in a deep blue bay surrounded by rugged limestone cliffs.
Credit: pexels.com, A breathtaking view of sailboats in a deep blue bay surrounded by rugged limestone cliffs.

To set up Azure URL configuration, you should start by creating a new Azure Storage account, which will serve as the foundation for your URL configuration.

Azure supports multiple types of storage accounts, including General Purpose v2 and FileStorage, but for URL configuration, General Purpose v2 is the recommended choice.

When configuring your Azure Storage account, it's essential to choose a unique name that will be used to access your storage resources.

In Azure, you can configure URL routing using Azure Front Door or Azure Application Gateway, both of which provide robust routing capabilities.

Getting Started

AzUrlShortener is an API that doesn't have any admin UI by default, so you'll need to get creative to manage your Short Urls.

You can use an API client like Postman or a plugin to VSCode like REST Client to make API calls.

AzUrlShortener provides a postman collection and environment to get you started with simple API calls.

You can also directly update the tables in storage using Azure Storage Explorer.

Azure URL Configuration

Credit: youtube.com, How to set up a custom domain name in Azure Static Web Apps [10 of 22] | Azure Tips and Tricks

Azure URL Configuration is crucial for various Azure services, including Azure Pipelines and App Service. The primary URL is the base URL for all URLs constructed by Azure DevOps in background jobs and other automated scenarios.

Azure Pipelines tasks and services must handle both the new and legacy URL forms, as the output can vary depending on the organization's URL format. For example, if the primary URL is the new URL form, the output is https://dev.azure.com/{organization}, while the legacy URL form outputs https://{organization}.visualstudio.com.

To ensure compatibility, Azure Pipelines tasks and services should be designed to handle both URL forms. This can be achieved by using environment variables, such as SYSTEM_TEAMFOUNDATIONCOLLECTIONURI, to provide the organization URL.

For more insights, see: Azure Create New App Service

With the Organization

With the organization, you can get its base URL using the global Resource Areas REST API. This API doesn't require authentication and provides information about the location (URL) of the organization and the base URL for REST APIs.

A laptop displaying an analytics dashboard with real-time data tracking and analysis tools.
Credit: pexels.com, A laptop displaying an analytics dashboard with real-time data tracking and analysis tools.

You can use the organization's name to get its base URL through various methods, including HTTP, C#, Node.js, and more. Replace {organizationName} with the organization's name, such as "Fabrikam".

The Resource Areas REST API returns URLs for the organization based on its designated primary URL. The locationUrl reflects the organization's base URL.

Here are some ways to get the base URL for an organization using its name:

  • HTTP
  • C# (client library)
  • C# (generic)
  • Node.js (generic)

The Microsoft-provided .NET client library (Microsoft.VisualStudio.Services.Client) provides a helper class called VssConnectionHelper, available in version 16.139.0-preview and later, which calls the Resource Areas REST API for you and returns the base URL for an organization.

How to Assign Custom URL to Website on App Service

To assign a custom URL to your website on App Service, you need to scale up your App Service Plan to enable Custom Domain Feature. This is because the free plan doesn't allow custom domains.

You can scale up your plan by clicking on the "Scale Up" setting under the App Service in Azure. From there, you can select the next tier up from the free plan, which is the D1 plan, estimated to cost about $10/month.

Credit: youtube.com, Add Custom Domain Name in Azure App Services

The main difference between the free F1 plan and the D1 plan is the Custom Domains feature, which is what you want. You can also scale up to the B1 plan for better resources, but it's more expensive.

Once you've scaled up to the D1 plan, you can add a custom domain to your website by clicking on "Custom Domains" under the website settings in Azure. This will show you the CNAME and A-record settings that you need to add to your domain hosting provider.

You'll need to update the DNS changes on your domain hosting provider's website, such as GoDaddy, by adding or updating the A-record and TXT DNS entry. This will map your custom domain name to your Azure website.

After updating the DNS changes, you can click on the "Add Hostname" button in the validation screen to add your custom domain to the App Service Custom Domains page. This will allow you to access your website using your custom domain name.

However, keep in mind that Azure's free SSL certificate is no longer valid once you've switched to a custom domain. You can either purchase a new SSL certificate or use one of the other options provided by Azure.

A unique perspective: Custom Domain Name Azure

URL Usage and Verification

Credit: youtube.com, AzUrlShortener: An open source, budget-friendly URL shortener | Azure Friday

The primary URL is used as the base URL for all URLs constructed by Azure DevOps in background jobs and other automated scenarios. This includes URLs provided to Azure Pipelines tasks via environment variables, such as SYSTEM_TEAMFOUNDATIONCOLLECTIONURI.

Azure Pipelines tasks and services must handle both the new URL form and the legacy URL form. The output of a task can vary depending on the organization's primary URL, displaying either https://dev.azure.com/{organization} or https://{organization}.visualstudio.com.

Azure Pipelines tasks and services must be able to handle both URL forms to ensure compatibility and avoid errors.

Primary URL Usage

The primary URL plays a crucial role in Azure DevOps, serving as the base URL for all URLs constructed in background jobs and automated scenarios. This means it's used in various places, such as environment variables, service hooks event payloads, and email notifications.

Azure Pipelines tasks and services need to handle both URL forms, as the primary URL can be either the new URL form (https://dev.azure.com/{organization}) or the legacy URL form (https://{organization}.visualstudio.com).

The primary URL is displayed in Azure Pipelines tasks, showing the organization URL provided to the task. If the task is executed on an organization with the new URL form, the output is the new URL form, while the legacy URL form outputs the legacy URL.

You might enjoy: Azure Legacy

Verify URL Rewrite via Access Logs

Credit: youtube.com, Troubleshooting URL Rewrite Failures in web.config for Localhost

To verify if your URL rewrite has taken effect, you can check the access logs. Observe the original request URL in the access logs.

The original request URL is contained in the field called "originalRequestUriWithArgs". This field holds the original request URL sent by the client.

You can also check the rewritten URL in the access logs. The rewritten URL is contained in the field called "requestUri". This field holds the URL after the rewrite operation on Application Gateway.

To summarize, you can verify the URL rewrite by checking two specific fields in the access logs: "originalRequestUriWithArgs" for the original request URL and "requestUri" for the rewritten URL.

Pipelines and Releases

In Azure URL, pipelines are a key component for automating the build, test, and deployment of your application.

Pipelines in Azure URL are a set of automated processes that run in a specific order, triggered by changes in your code repository.

You can create multiple pipelines for different environments, such as dev, staging, and production.

Credit: youtube.com, Azure Pipelines - Release

Each pipeline can have multiple stages, including build, test, and deploy.

Azure URL provides a visual interface for creating and managing pipelines, making it easy to see the workflow and identify any issues.

The visual interface also allows you to add custom actions and gates to your pipeline, giving you more control over the deployment process.

Releases in Azure URL are a way to manage the deployment of your application to different environments.

Releases can be created from a pipeline, and they provide a way to track the deployment of your application to different environments.

You can also use releases to roll back to a previous version of your application if something goes wrong.

Releases are versioned, so you can easily track changes and identify the version of your application that was deployed to each environment.

Frequently Asked Questions

What is my Azure server URL?

To find your Azure server URL, sign in to the Azure portal (https://portal.azure.com) and navigate to Azure Active Directory > Mobility (MDM and MAM). Your MDM server URL will be listed for different platforms.

Where is the Azure login URL?

The Azure login URL is https://portal.azure.com/. Access it in your web browser to begin the login process.

Ann Predovic

Lead Writer

Ann Predovic is a seasoned writer with a passion for crafting informative and engaging content. With a keen eye for detail and a knack for research, she has established herself as a go-to expert in various fields, including technology and software. Her writing career has taken her down a path of exploring complex topics, making them accessible to a broad audience.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.