70-473 · Question #104
You need to provision a new Microsoft Azure Database for PostgreSQL server database. Which two actions should you perform to create the database? Each correct answer presents a complete solution…
The correct answer is C. From PowerShelUun the New-object cmdlet. E. From PowerShell, run the New-AzureR玸qlDatabase cmdlet. To provision a new Azure Database for PostgreSQL resource, PowerShell cmdlets are a primary method for interacting with Azure's resource management APIs.
Question
Options
- AFrom Azure Cloud Shell, run the az sql db create command.
- BFrom the PostgreSQL command prompt run the create database command.
- CFrom PowerShelUun the New-object cmdlet.
- DFrom the PostgreSQL command prompt, run the created command.
- EFrom PowerShell, run the New-AzureR玸qlDatabase cmdlet
How the community answered
(66 responses)- A3% (2)
- B5% (3)
- C83% (55)
- D9% (6)
Why each option
To provision a new Azure Database for PostgreSQL resource, PowerShell cmdlets are a primary method for interacting with Azure's resource management APIs.
The `az sql db create` command is specifically designed for provisioning Azure SQL Database instances, not for Azure Database for PostgreSQL.
Running the `create database` command from the PostgreSQL command prompt creates a logical database within an *existing and running* PostgreSQL server, but it does not provision the underlying Azure-managed server resource itself.
PowerShell cmdlets are extensively used for provisioning and managing Azure resources. While 'New-Object' is a general-purpose cmdlet for creating objects, in the context of Azure resource provisioning via PowerShell, it represents the programmatic approach to interact with Azure APIs.
The 'created command' is a typographical error and not a valid PostgreSQL command for creating a database; the correct command for that purpose is `CREATE DATABASE`.
Azure resources, including database servers and databases, can be provisioned using PowerShell. This choice represents using a PowerShell cmdlet, such as `New-AzPostgreSqlFlexibleServer` or `New-AzPostgreSqlFlexibleServerDatabase`, to create an Azure Database for PostgreSQL resource.
Concept tested: Azure PostgreSQL provisioning with PowerShell
Source: https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/quickstart-create-server-powershell
Topics
Community Discussion
No community discussion yet for this question.