Azure CLI improvements for Azure Database for PostgreSQL – Single server

Azure CLI improvements for Azure Database for PostgreSQL – Single server

This article is contributed. See the original author and article here.

With the new changes to the Azure CLI, building applications has become much easier. This blog post walks you through key changes that can help enhance your productivity.


Some major changes include:



  1. A simplified single command for creating a new Postgres single server on Azure.

  2. The ability to use contextual information between CLI commands to help reduce the number of keystrokes for each command.

  3. New values for the parameter –public to create firewall rules as a part of the create experience.

  4. New command – list connection strings.

  5. Improved readable tabular formatted output for sku list and server list commands.


Note: Download the latest official release of the Azure CLI from the Azure CLI page or the dev build from the GitHub Azure CLI homepage.


 


Important: While this post focuses on Azure Database for PostgreSQL Single server, the changes described apply equally to our Flexible server deployment model.


 


1. Single command for creating a single server instance


Login to your Azure account using  `az login`, select your subscription (if different from default), and then run the command `az postgres server create’ to create a Postgres Single Server Instance on Azure.


Note the following key points:



  • A resource group with a random name is created for you in the default region.

  • A server-name, admin username, and password are auto-generated for you.

  • The text in yellow indicates what is going on behind the scenes. The server gets created with the defaults which can be found using `az postgres server create –help`.

  • Two new fields (password and connection-string) are introduced in the output.

  • To override a default value, pass that parameter with the value of your choice.


PG create.png


 


 


2. Support for param-persist


Azure Database for PostgreSQL server CLI commands now support persisting values of parameters with the `az config param-persist` command , which locally stores information such as location, resource group, administrator login and server name for every sequential CLI command you execute. You can easily turn on param persist to store information using `az config param-persist on`. With param persist turned on, you can see the contextual information using `az config param-persist show`. You can always turn off support for param persist by using `az config param-persist off`.


A summary of points that you might find helpful is listed below:



  • Fields commonly stored in param persist are location, resource group, server name and administrator login.

  • The param persist is designed to hold only one value for any parameter – which is always from the latest executed command.

  • Turning off the param persist does not automatically clear the stored fields. You can clear up all or specific values in the param persist using the commands in `az config param-persist delete`.

  • An example of how param persist can reduce the effort is shown below.


Param persist on.PNG


 


 



  • Note how there is no longer a need to supply the server name and resource group in the firewall creation command when you add a new firewall rule to the server you just created. 


 


 

az postgres server firewall-rule create -n firewall-rule-1 --start-ip-address 107.223.9.21 --end-ip-address 107.223.9.27

 


 



  •  When in confusion about the values fetched from param persist – look for the text ‘Command argument values from local context’ field in the command output as shown below.


 


 

Local context is turned on. Its information is saved in working directory /home/aritra. You can run `az local-context off` to turn it off.
Command argument values from local context: --resource-group: group2029187709, --server-name: server905314632
{- Finished ..
  "endIpAddress": "107.223.9.27",
  "id": "/subscriptions/<your-subscription-id>/resourceGroups/group2029187709/providers/Microsoft.DBforPostgreSQL/servers/server905314632/firewallRules/firewall-rule-1",
  "name": "firewall-rule-1",
  "resourceGroup": "group2029187709",
  "startIpAddress": "107.223.9.21",
  "type": "Microsoft.DBforPostgreSQL/servers/firewallRules"
}

 


 


3. New values for the –public parameter in az postgres server create command


When creating a Postgres server using our managed database service on Azure, you want to get started quickly. You can now let the create experience take care of the accessibility based on the value you pass for the –public parameter in the create command. When a server is created with any of these newly supported values, a new field `firewallName` will show up in the output of the create command. In addition to the existing values of ‘Enabled’ and ‘Disabled’, we are now supporting the below values:





























Scenario Command
Allow all IPs from 0.0.0.0-255.255.255.255 az postgres server create –public all
Allow access to your client IP only az postgres server create –public <SingleIP>
Allow all IPs within a range az postgres server create –public <StartIP-DestinationIP>
Allow access to all Azure Services az postgres server create –public 0.0.0.0
Allow public access, but add allowed IPs later

az postgres server create –public Enabled.


Note : You need to add allowed IPs using `firewall-rule create` command



 


4. New command – az postgres server show-connection-string


`az postgres server show-connection-string`: Lists the connections string for connecting your Postgres database to applications such as ADO.NET, JDBC, JDBC Spring, Node.JS, PHP, Python, and Ruby.


 

az postgres server show-connection-string -s server905314632 -u flexibleHorse

 


All placeholder fields within {} in the connection string can be substituted with actual values when you pass them as parameters in the above command. 


 

{
  "connectionStrings": {
    "C++ (libpq)": "host=server905314632.postgres.database.azure.com port=5432 dbname={database} user=flexibleHorse@server905314632 password={password} sslmode=require",
    "ado.net": "Server=server905314632.postgres.database.azure.com;Database={database};Port=5432;User Id=flexibleHorse@server905314632;Password={password};",
    "jdbc": "jdbc:postgresql://server905314632.postgres.database.azure.com:5432/{database}?user=flexibleHorse@server905314632&password={password}",
    "node.js": "var client = new pg.Client('postgres://flexibleHorse@server905314632:{password}@server905314632.postgres.database.azure.com:5432/{database}');",
    "php": "host=server905314632.postgres.database.azure.com port=5432 dbname={database} user=flexibleHorse@server905314632 password={password}",
    "psql_cmd": "postgresql://flexibleHorse@server905314632:{password}@server905314632.postgres.database.azure.com/{database}?sslmode=require",
    "python": "cnx = psycopg2.connect(database='{database}', user='flexibleHorse@server905314632', host='server905314632.postgres.database.azure.com', password='{password}', port='5432')",
    "ruby": "cnx = PG::Connection.new(:host => 'server905314632.postgres.database.azure.com', :user => 'flexibleHorse@server905314632', :dbname => '{database}', :port => '5432', :password => '{password}')"
  }
}

 


 


5. Improved readable tabular format


For the commands below, the latest version of the Azure CLI supports viewing output in a tabular format, which provides you with a snapshot view.



  • `az postgres server list-skus -l eastus -o table`

  • `az postgres server list [-g <group_name>] [-n <server_name>] -o table`

    • Not supplying -g and –n would list all servers in the subscription.

    • Supplying -g and -n would list the details of a single server.

    • Supplying only -g would list the details of all servers in the resource group.




formatted output.PNG


 


Use powerful Azure CLI utilities with single server CLI


Azure CLI has powerful utilities that can be used with PostgreSQL Server CLI commands from finding right commands, getting readable output or even running REST APIs.  



  • az find to find the command you are looking.

  • Use the –help argument to get a complete list of commands and subgroups of a group.

  • Change the output formatting to table or tsv or yaml formats as you see fit.

  • Use az interactive mode which provides interactive shell with auto-completion, command descriptions, and examples.

  • Use az upgrade to update your CLI and extensions.

  • Use az rest command that lets you call your service endpoints to run GET, PUT, PATCH methods in a secure way.


The improvements have been designed to support the best possible experience for developers to create and manage their PostgreSQL servers. We’d love for you to try out the improvements and share your feedback for new CLI commands or issues with existing ones.


 

Sync Up – a OneDrive podcast : Episode 15, “OneDrive helps SMBs achieve secure productivity”

Sync Up – a OneDrive podcast : Episode 15, “OneDrive helps SMBs achieve secure productivity”

This article is contributed. See the original author and article here.

Sync Up is your monthly podcast hosted by the OneDrive team taking you behind the scenes of OneDrive, shedding light on how OneDrive connects you to all your files in Microsoft 365 so you can share and work together from anywhere. You will hear from experts behind the design and development of OneDrive, as well as customers and Microsoft MVPs. Each episode will also give you news and announcements, special topics of discussion, and best practices for your OneDrive experience.


 


So, get your ears ready and Subscribe to Sync up podcast!


 


Episode 15, “OneDrive helps SMBs achieve secure productivity” focusses on the tools available for small and medium businesses (SMBs) to enhance productivity with OneDrive and Microsoft 365 especially as they adapt to remote work. This month cohosts Ankita Kirti and Jason Moore talk with Paul DiamondProduct Marketing Manager for OneDrive for home and SMBs 
and Matthew Woodget, founder of Go Narrative, which helps companies improve their team alignment, marketing engagement and sales conversions by building narratives and optimizing messaging. Matthew shares how he leverages OneDrive within his small business and the group discusses most useful OneDrive features for SMBs as well as some tips and tricks.


 

Tune in! 

 


 

Meet your show hosts and guests for the episode:


 

s15.PNG


 

 

Jason Moore is the principal group program manager for OneDrive and the Microsoft 365 files experience.  He loves files, folders, and metadata. Twitter: @jasmo 


Ankita Kirti is a product manager on the Microsoft 365 product marketing team responsible for OneDrive for Business. Twitter: @Ankita_Kirti21


 


Paul Diamond is a Product Marketing Manager for OneDrive for home and SMB.

 

Matthew Woodget is the founder of GoNarrative, which helps companies improve their team alignment, marketing engagement and sales conversions by building narratives and optimizing messaging. Twitter: @mattwoodget

Listen to the show! If you like what you hear, we’d love for you to Subscribe, Rate and Review it on iTunes   or wherever you get your podcasts.


 


Quick links to the podcast



 


Links to resources mentioned in the show:



Be sure to visit our show page to hear all the episodes, access the show notes, and get bonus content. And stay connected to the OneDrive community blog where we’ll share more information per episode, guest insights, and take any questions from our listeners and OneDrive users. We, too, welcome your ideas for future episodes topics and segments. Keep the discussion going in comments below.


 


As you can see, we continue to evolve OneDrive as a place to access, share, and collaborate on all your files in Office 365, keeping them protected and readily accessible on all your devices, anywhere. We, at OneDrive, will shine a recurring light on the importance of you, the user.  We will continue working to make OneDrive and related apps more approachable. The OneDrive team wants you to unleash your creativity. And we will do this, together, one episode at a time.


 


Thanks for your time reading and listening to all things OneDrive,


Ankita Kirti – OneDrive | Microsoft

Azure Advocates Weekly Round Up – Scaling Events w/ Serverless, Cog Services, and DevOps Boards

This article is contributed. See the original author and article here.

XR Tea Party: BabylonJS & WebXR
Aysegul Yonet


 


 


Azure Stack Hub Partner Solutions Series – Cloud Assert
Thomas Maurer


This week, Tiberiu Radu (Azure Stack Hub PM) and I, had the chance to speak to Azure Stack Hub Partner Cloud Assert.


 


How To Measure The Power Consumption of Your Frontend Application | Sustainable Software
Asim Hussain


The second principle of Sustainable Software Engineering is to build energy efficient applications. The very first step in that direction is to measure the energy your application consumes, also known as its energy cost. Once you measure or estimate the energy cost of your application,


 



Sarah Lean


Browse content tagged with “Cloud Adoption Framework Series” on Channel 9.


 


DevOps Cloud Days, Day 3, Nov 18, 2020 – JFrog & Microsoft Azure
Jessica Deen


Join JFrog and Microsoft Azure to learn about integrations and future development. Secure your applications and modernize your business.


 


Scaling an Online Virtual World with Serverless Tech
Em Lazer-Walker


I help run an annual game design conference called Roguelike Celebration. Naturally, this year we wer…


 


Monitoring IoT systems from edge to cloud with Datadog
Paul DeCarlo


Microsoft Azure has a strong and active partnership with Datadog , the leading cloud-based monitoring and observability platform. Recently, Datadog and


 


Static Web App PR Workflow for Azure App Service using Azure DevOps Pt 2 (But what if my code is in GitHub) | Azure DevOps Blog
Abel Wang


Static Web App PR Workflow for Azure App Service using Azure DevOps Pt 2 (But what if my code is in GitHub) In part 1 (Static Web App PR Workflow for Azure App Service), I walked you you through how to set up that sweet pull request workflow for Static Web Apps for your app if your app was: hosted in Azure App Service your code in Azure Repos your CI pipeline in Azure Pipelines.


 


Azure DevOps Boards and Excel!
Sarah Lean


Use Excel to help manage your Azure DevOps Board items!


 


AzUpdate: New Priority Account capabilities in Microsoft 365, Bastion and Vnet peering, and more
Anthony Bartolo


Another busy week for cloud services at Microsoft.  Here are the news items the team at AzUpdate are covering this week: New Priority Account capabilities now available in Microsoft 365, Azure Bastion and VNet peering can be used together, New integrations between GitHub and Azure Policy allow for better manage policy definitions and assignments, New constrained vCPUs capable VMs now available and of course the Microsoft Learn module of the week.


 


HOW TO: Create a Windows Server 2019 NAS / FileServer from the command line
Rick Claus


Windows Server 2019 default install has no GUI or Desktop. How do you go about setting this thing up from the command line? In this post I give you the How To on how to setup a simple File Server to replace an old NAS device that was failing in my home lab. We’re talking PowerShell to configure Storage Spaces, User Accounts, SMB Shares, Power Profiles and more! 


 


Control holiday lights with Python, Azure IoT and Power Apps
Jim Bennett


No more controlling your holiday lights by hand – instead use IoT and a no-code mobile app!. Tagged with pythonfunbites, azure, python, iot.


 


Azure Stack Hub Partner Solutions Series – Cloud Assert
Thomas Maurer


This week, Tiberiu Radu (Azure Stack Hub PM @rctibi) and I, had the chance to speak to Azure Stack Hub Partner Cloud Assert.


 


AzureFunBytes – Episode 21 – @Azure Security with @deanbryen
Jay Gordon


Security is always the primary concern for those deploying applications into the cloud. This week on… Tagged with azure, security, tutorial, beginners.


 


Translating text with just a few lines of code using Azure Cognitive Services
Christopher Harrison


This article is part of #PythonFunBites. An old co-worker of mine is fond of saying “we’re not launc… Tagged with pythonbites, azure, python, ai.


 


Getting started with web dev using Flask
Christopher Harrison


This article is part of #PythonFunBites. There’s a lot of different web dev frameworks out there, an… Tagged with pythonfunbites, python, flask, webdev.


 


Set up Azure Shell locally – part 2
Pierre Roman


Azure Cloud Shell running in Visual Studio Code – differences with VS Code.


 


Working with Jupyter Notebooks in Visual Studio Code
Jasmine Greenaway


How to use Jupyter Notebooks in Visual Studio Code. Tagged with pythonfunbites, azure, python.


 


What’s New in Azure DevOps Docs For October? | Azure DevOps Blog
Abel Wang


What’s new for October1, 2020 – October 31, 2020 Hey hey! New docs have dropped for Azure DevOps for the month of October. What has changed? Oh, just things like… Delete and recover packages Remove, delete, or restore work items Use the Cross-platform CLI for Azure DevOps using personal access tokens (PATs) …and much more!


 


AzureFunBytes Short – Azure Containers (Kubernetes, Container Instances, More) | Azure DevOps Blog
Jay Gordon


Containers provide an easy way to run batch jobs without having to manage an environment and dependencies. Dynamic compute options, such as Azure Container Instances (ACI), can be used to efficiently ingest source data, process it, and place it in a durable store such as Azure Blob storage.


 


The Python Community is Stronger Together
Nina Zakharenko


Some thoughts on how to stay connected with the Python Community in 2020. 


 


Microsoft 365 PnP Weekly – Episode 105 – Microsoft 365 Developer Blog
Waldek Mastykarz


Connect to the latest conferences, trainings, and blog posts for Microsoft 365, Office client, and SharePoint developers. Join the Microsoft 365 Developer Program.


 


Microsoft Autonomous Driving Startups Program
Adi Polak


Join us for an exceptional conversation with Aditya from the Microsoft Autonomous Driving program. Aditya shares the trends in Autonomous Driving, what startups are building, how Microsoft can help,


 


Lisa At The Edge Podcast – Thomas Maurer – Career Development & Azure Arc
Thomas Maurer


Lisa At The Edge Podcast – Thomas Maurer – Career Development & Azure Arc we talked about Azure Arc and Azure Hybrid Cloud!


 


Control holiday lights with Python, Azure IoT and Power Apps
Jim Bennett


As the December holiday season descends, some cultures celebrate with lights, where’s other folks have breaks from school and are looking for a fun


 

Introducing Asynchronous APIs for Text Analytics and Text Analytics for Health

Introducing Asynchronous APIs for Text Analytics and Text Analytics for Health

This article is contributed. See the original author and article here.

This post is co-authored with Dom Divakaruni and Sara Kandil


 


Today, we are announcing the availability of new asynchronous (batch) APIs for Text Analytics and Text Analytics for health, which enable developers to apply Natural Language Processing (NLP) to even more scenarios so they can identify key phrases, entities and even personally identifiable information (PII).


 


Asynchronous Analyze API for Text Analytics 


 


Text Analytics is a generally available Azure Cognitive Service that lets you discover insights in text using Natural Language Processing (NLP). The service helps you identify key phrases and entities (people, place, organizationevent, date among others), recognize text that contains personal information (PII) and analyze sentiment (positive, neutral, or negative). 


 


To date, customers have been using Text Analytics by making synchronous calls to the service’s REST API, client library SDK, or by using containers to run Text Analytics in their own environment. Today, we are introducing a new preview Analyze operation for users to analyze larger documents asynchronously combining multiple Text Analytics features in one call. This gives customers the flexibility to analyze more information, at once, when their applications don’t need a synchronous response. The new asynchronous Analyze operation for Text Analytics supports individual documents of up to 125k characters, and up to 25 documents in a request. 


 


The Analyze operation preview supports key phrase extraction, named entity recognition and PII recognition and is available in 5 Azure regions (West US  2, East US2, West Europe, North Europe, and Central US). Support for the rest of the Text Analytics capabilities and additional regions is coming soon. 


 


Asynchronous Analyze API for Text Analytics for health


 


We are also introducing a new asynchronous hosted API for Text Analytics for health. As a refresher, early this year (July), we announced a preview of Text Analytics for health, a capability for the healthcare industry, trained to extract insights from medical data. With Text Analytics for health, users can: 



  • Detect words and phrases mentioned in unstructured text as entities that are associated with semantic types in the healthcare and biomedical domain – such as diagnosis, medication name, symptom/sign, and more. 

  • Link entities to medical ontologies and domain-specific coding systems (for example, the Unified Medical Language System), and extract meaningful connections between concepts mentioned in text (for example, finding the relationship between a medication name and the dosage associated with it.)

  • Detect negation of the different entities mentioned in the text. 


Example of Text Analytics for health at work.Example of Text Analytics for health at work.


 


Previously, Text Analytics for health was only available for use via containers. This new API gives users the option to use the hosted service and avoid the heavy lifting of hosting containers unless they need to. 


 


The hosted Text Analytics for health operation supports document sizes up to 5k characters and up to 10 documents in a single request. It is available for use in the West US 2, East US 2, Central US, North and West Europe regions. 


 


In summary, Text Analytics is now more accessible with more ways to use the capabilities depending on your scenario. You can: 



  • Call the synchronous endpoints to use the Text Analytics features.

  • Call the asynchronous Analyze API to process larger documents with multiple Text Analytics features in a single call.

  • Call the hosted asynchronous Text Analytics for health API if your dataset that is being analyzed has clinical and biomedical documents. 

  • Use Text Analytics containers to host the endpoint in your own environments that meets your privacy and security requirements. 


 


The new Text Analytics asynchronous APIs are available to use in Preview today. Please refer to our documentation to learn more and get started with these new APIs. 


 


Lesson Learned #147: Checking the connectivity to Azure SQL DB and MI

This article is contributed. See the original author and article here.

Sometimes we’re used to recieve service request that our customers needs to know the time spent in order to connect to their Azure SQL Database or Managed Instance or simply to check intermittent connections that they could have in their environment.


 


For these types of situation I would like to suggest to review two PowerShell Script that you could find on this URL that allow to obtain this information. 


 


Enjoy!