Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
The Basic, Standard, and Enterprise plans will be deprecated starting from mid-March, 2025, with a 3 year retirement period. We recommend transitioning to Azure Container Apps. For more information, see the Azure Spring Apps retirement announcement.
The Standard consumption and dedicated plan will be deprecated starting September 30, 2024, with a complete shutdown after six months. We recommend transitioning to Azure Container Apps.
This article describes how you can create an instance of Azure Spring Apps by using the Az.SpringCloud PowerShell module.
The requirements for completing the steps in this article depend on your Azure subscription:
- If you don't have an Azure subscription, create a Trial before you begin.
- If you choose to use Azure PowerShell locally:
- Install the latest version of the Az PowerShell module.
- Connect to your Azure account using the Connect-AzAccount -Environment AzureChinaCloud cmdlet.
Important
While the Az.SpringCloud PowerShell module is in preview, you must install it by using
the Install-Module
cmdlet. See the following command. After this PowerShell module becomes generally available, it will be part of future Az PowerShell releases.
Install-Module -Name Az.SpringCloud
If you have multiple Azure subscriptions, choose the appropriate subscription in which the resources should be billed. Select a specific subscription by using the Set-AzContext cmdlet:
Set-AzContext -SubscriptionId <subscription-ID>
A resource group is a logical container in which Azure resources are deployed and managed as a group. Create an Azure resource group by using the New-AzResourceGroup cmdlet. The following example creates a resource group with a specified name and location.
New-AzResourceGroup -Name <resource group name> -Location chinanorth2
To create a new instance of Azure Spring Apps, you use the New-AzSpringCloud cmdlet. The following example creates an Azure Spring Apps service, with the name that you specified in the resource group you created previously.
New-AzSpringCloud -ResourceGroupName <resource group name> -name <service instance name> -Location chinanorth2
To create a new app, you use the
New-AzSpringCloudApp cmdlet. The following example creates an app in Azure Spring Apps named gateway
.
New-AzSpringCloudApp -ResourceGroupName <resource group name> -ServiceName <service instance name> -AppName gateway
To create a new app Deployment, you use the
New-AzSpringCloudAppDeployment
cmdlet. The following example creates an app deployment in Azure Spring Apps named default
with an empty welcome application, for the gateway
app.
$welcomeApplication = New-AzSpringCloudAppDeploymentJarUploadedObject -RuntimeVersion "Java_11"
New-AzSpringCloudAppDeployment -ResourceGroupName <resource group name> -ServiceName <service instance name> -AppName gateway -Name default -Source $welcomeApplication
To get an Azure Spring Apps service and its properties, you use the Get-AzSpringCloud cmdlet. The following example retrieves information about the specified Azure Spring Apps service.
Get-AzSpringCloud -ResourceGroupName <resource group name> -ServiceName <service instance name>
To get an app and its properties in Azure Spring Apps, you use the
Get-AzSpringCloudApp cmdlet. The following example retrieves information about the app gateway
.
Get-AzSpringCloudApp -ResourceGroupName <resource group name> -ServiceName <service instance name> -AppName gateway
To get an app deployment and its properties in Azure Spring Apps, you use the
Get-AzSpringCloudAppDeployment cmdlet. The following example retrieves information about the default
Azure Spring Apps deployment.
Get-AzSpringCloudAppDeployment -ResourceGroupName <resource group name> -ServiceName <service instance name> -AppName gateway -DeploymentName default
If the resources created in this article aren't needed, you can delete them by running the examples shown in the following sections.
To remove an app deployment in Azure Spring Apps, you use the
Remove-AzSpringCloudAppDeployment cmdlet. The following example deletes an app deployed in Azure Spring Apps named default
, for the specified service and app.
Remove-AzSpringCloudAppDeployment -ResourceGroupName <resource group name> -ServiceName <service instance name> -AppName gateway -DeploymentName default
To remove an app in Azure Spring Apps, you use the
Remove-AzSpringCloudApp cmdlet. The following example deletes the gateway
app in the specified service and resource group.
Remove-AzSpringCloudApp -ResourceGroupName <resource group name> -ServiceName <service instance name> -AppName gateway
To remove an Azure Spring Apps service, you use the Remove-AzSpringCloud cmdlet. The following example deletes the specified Azure Spring Apps service.
Remove-AzSpringCloud -ResourceGroupName <resource group name> -ServiceName <service instance name>
Caution
The following example deletes the specified resource group and all resources contained within it. If resources outside the scope of this article exist in the specified resource group, they will also be deleted.
Remove-AzResourceGroup -Name <resource group name>