title | description | author | ms.author | ms.topic | ms.service | ms.devlang | ms.date | ms.custom |
---|---|---|---|---|---|---|---|---|
Create and deploy applications in Azure Spring Apps by using PowerShell |
How to create and deploy applications in Azure Spring Apps by using PowerShell |
karlerickson |
karler |
conceptual |
spring-apps |
azurepowershell |
2/15/2022 |
devx-track-azurepowershell, event-tier1-build-2022, devx-track-java |
Note
Azure Spring Apps is the new name for the Azure Spring Cloud service. Although the service has a new name, you'll see the old name in some places for a while as we work to update assets such as screenshots, videos, and diagrams.
This article applies to: ✔️ Basic/Standard tier ✔️ Enterprise tier
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 free account before you begin.
[!INCLUDE azure-powershell-requirements-no-header.md]
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 and available by default from within Azure Cloud Shell.
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 00000000-0000-0000-0000-000000000000
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 eastus
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 eastus
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
, for the gateway
app.
New-AzSpringCloudAppDeployment -ResourceGroupName <resource group name> -Name <service instance name> -AppName gateway -DeploymentName default
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>