In this blog post I will describe the differences between Azure Policy exclusions, exemptions and overrides.
If you missed out on my previous post on Azure policy inheritance you can find the article at the following link Azure Policy Inheritance explained
Let’s get started and understand the differences and use cases for each.
Azure Policy Exclusions Azure Policy allows organisations to enforce rules and compliance across resources in Azure. Compliance status is visible within the Azure Policy overview page which provides a single pane of glass view of resources which are compliant or non-compliant in their environments. However, there are requirements where organisations may not want Azure Policy to scan all resources. One of the features of Azure Policy is the ability to exclude certain resources from an Azure policy assignment. This is known as Azure Policy Exclusions. Let’s continue to a couple of examples below where we could use Azure Policy Exclusions.
Example Your organisation has a policy that audits all storage accounts to ensure the replication for disaster recovery purposes is set to geo-redundant replication.
However, there is one subscription that contains storage accounts used for development and testing purposes that do not need to be scanned by this policy. In this case, you can create a policy assignment that applies to all subscriptions, and exclude the subscription containing the development and testing storage accounts. This way, the policy will apply to all storage accounts except for those in the excluded subscription. Furthermore, those storage accounts from the excluded subscription will not appear on the Azure Policy overview page as non-compliant.
Another Example Your organisation has a policy that requires all virtual machines to be deployed in a specific region for compliance reasons. However, there is one resource group that contains virtual machines used for disaster recovery purposes that need to be deployed in a different region. In this case, you can create a policy assignment that applies to all subscriptions and resource groups, and exclude the resource group containing the disaster recovery virtual machines. This way, the policy will apply to all virtual machines except for those in the excluded resource group.
Where is the exclude option?
When assigning an initiative/definition the option to exclude appears below the field named scope as shown in the image below.
Let’s move on to Azure Policy Exemptions in the next section below.
Azure Policy Exemptions The Azure Policy exemptions feature is used to exempt a resource hierarchy or resources from being evaluated. Resources that are exempt are not evaluated because there may be a time bound waiver with an expiration date applied by an engineer. A benefit of exemptions is that they are audited, including the reason why an engineer created an exemption, the name of the engineer, and time the exemption was created. All exemptions can be tracked in the Azure Policy portal. Let’s continue to a use case of an exemption below.
Example Let’s say we are applying the built-in definition “Storage accounts should disable public network access” with an effect set to audit. We find that the compliance assessment shows that a storage account named “imransstorageaccount” is found to be non-compliant, but it must have public network access enabled for business purposes. How do we get around this non-compliant resource? We can create an exemption and type a reason why “imransstorageaccount” was exempted. Once the exemption is created, “imransstorageaccount” will be shown as exempt in compliance view in Azure Policy.
Note: It is important to regularly review your exemptions to ensure that all eligible items are appropriately exempted and to promptly remove any that no longer qualify for exemption.
Where is the exemption option? 1. Access Azure Policy and click Assignments under the section Authoring. As shown in the image below.
2. Click the ellipsis icon (the three dots) by the policy assignment you wish to exclude and click create exemption,
3. Once the exemption window launches you can select an exemption category of Waiver, for example if you are due to delete/decommission the resource. The second option is mitigated, where you may have resolved the non-compliance issue via a different method. Providing a reason why a resource is exempted allows for the reason to be audited.
You can also apply an exemption expiration date.
The policy exemption isn’t deleted when the expiry date is reached. The object is preserved for record keeping, but the exemption is no longer honored and Azure Policy will scan the resource again and mark it as compliant or non-compliant.
Exemption history can be viewed by clicking Exemptions located under the section Authoring. As shown in the image below.
So what is the difference between Azure Policy exclusions and exemptions?
1. Exemptions can be time bound, for example, exempt for 1 month and then start scanning and reporting on the compliant status again. 2. Exemptions are audited so it is possible to check why a policy was temporary or permanently exempt. 3. Exemptions are configured after the resource has been scanned and appears as non-compliant. We can then create an exemption for the non-compliant resource if required. 4. Azure Policy Exclusions are different. When we create an exclusion, Policy does not scan the excluded scope or mark it as compliant or non-compliant because it is ignored. Exclusions can not be configured to be temporary/time bound with an expiration date.
Azure Policy Overrides(In preview at the time of writing) Overrides is a feature which offers a capability different to exclusions and exemptions. The overrides property allows you to change the effect of a policy definition without modifying the underlying policy definition and in turn reducing the management overhead. Let me give you examples of use cases below.
Example You have assigned an initiative which includes/groups together a number of single definitions. Let’s say that one or more of the definitions inside your initiative has an effect of audit, however you wish to change the policy effect to deny. Azure policy override allows you to override the effect from audit to deny so that you don’t have to recreate azure polices or change the effect parameter within the policy template/JSON code. I could simply override an existing effect of deny to audit by editing the existing assigned policy and adding an override of change effect from audit to deny. I can add and remove overrides when needed.
Another example I have a policy initiative named Security that includes several policy definitions, such as RestrictVMSize and RequireSQLDatabaseAuditing. The default effect of these policy definitions is audit. However, I now want to change the effect of these policy definitions to deny without modifying the underlying policy definitions or amending the parameter effect in the policy definitions template.
To achieve this, I can use Azure Policy overrides to change the effect of the policy definitions to deny. I can create an override for each policy definition and set the effect to deny. If needed, I can remove the override at a later date which will revert the effect back to the original effect of audit without me having to change the JSON file.
Where is the override option? An override can be applied to a policy at the time of policy assignment or by editing an existing assignment.
1. Click Assignments under the section Authoring.
2. By the assignment name, click the ellipsis icon (…) and click edit assignment.
3. Click the advanced tab
4. Click Add override
5. Click override value and change the effect.
6. In my case, I have a policy which does not allow resources to be deployed to any region apart from UK South. My policy effect is currently set to deny. For demo purposes, I am going to add an override with an effect of audit. Click Add to apply the override and then click review and save.
Now the policy will not deny when resources are built outside of the UK South region but audit only and mark them as non-compliant. I can remove or edit the override when needed. Note an override was added to this policy for demo purposes only. Plan your overrides accordingly.
In this blog post I will explain how Azure Policy inheritance works using different scenarios/demos. If you are not aware of what Azure Policy is, click the following Microsoft Learn link to learn more, Overview of Azure Policy.
When we assign Azure Policies in our Azure environments we have the option to scope a policy at different levels including Management Groups, Subscriptions and Resource Groups as shown in the image below. The diagram below shows that we can apply Azure Policies at three levels, Management Groups, Subscriptions and Resource Groups.
Like RBAC (Role Based Access Control) permissions, policies also inherit from top down in the Azure Hierarchy. So if I scoped/assigned a policy at the Management Group level, that policy would inherit down to subscription, resource group and the three resources in my diagram, Virtual Machine 1 (VM1), Virtual Machine 2 (VM2) and Virtual Machine 3 (VM3). I have used virtual machines in my example, but this could be any type of Azure resource.
If I was to assign a policy at the Management Group scope allowing engineers in my organisation to deploy Virtual Machines to the Azure UK South region only, that policy would inherit down to the subscription and resource group. Therefore, my engineers would not be able to deploy Virtual Machines to any other region apart from the UK South region in the existing subscription and resources group, and any new subscriptions or resource groups deployed under my Management group in future as the policy would automatically apply.
Let’s go through a few commonly asked questions,
Question 1: If you apply a policy to the Management group which only allows resources to be deployed in the UK South Region, and that policy is inherited by subscription and resource group, what would we expect to happen if I deployed a new Virtual Machine called VM4 to a different region such as as East US into the resource group?
Result The deployment would be prevented by the policy and the engineer would not be allowed to deploy to the East US region because the policy scoped to the management group is being enforced. As shown in the image below. I have tried deploying VM4 to the East US region and been denied due to the policy applied at the Management Group level which has inherited all the way down, by design.
Question 2: In the example above, you tried deploying to resource group named ResourceGroup1 and the policy denied you from trying to build a new VM4 in region East US. What if you create a new resource group name ResourceGroup2 and try deploying VM4 to East US or any other region inside the newly created resource group?
Result: It will be denied, why? because the policy applied to the Management Group applies to all new resource groups under that Management Group. The new resource group ResourceGroup2 inherits the policy from above. Again, the below image shows the policy preventing VM4 from being deployed in East US in a new resource group named ResourceGroup2.
Question 3: What about the resources (VM1, VM2 and VM3) which were deployed and already exist in Resource Group1 as shown in the diagram below. What would happen if VM1 was located in UK South and VM2 and VM3 were located outside of the UK South region, before you applied the policy? what would happen to existing resources that are already there?
Answer: If the three resources, in my case three existing virtual machines VM2 and VM3 were deployed outside of the UK South region and VM1 was deployed in UK South region, then Azure Policy would display VM1 as compliant for being deployed in UK South, and the other two VM2 and VM3 as non-compliant. The Azure policy overview page would report this.
Question 4: What would happen if you created another policy and assigned at the resource group level, but the new policy assigned to the resource group allowed deployment to East US region only, so denying UK South? You now have one policy applied to the Management Group which allows deployments to UK South region only (inherited down), and a new policy assigned to the resource group which only allows deployments to East US. Which one policy would win? as show in the image below.
Result I leave the existing policy assigned to the management group, allowing resources to be deployed in UK South only. I have created a new policy and assigned to the resource group which only allows resources to be deployed to East US region. We now have conflicting policies.
The images below show that I have applied a policy to ResourceGroup1, allowing resources to be deployed inside that resource group but to East US region only.
What was the result?
1. Was I able to deploy a new virtual machine called VM4 in ResourceGroup1 in the UK South Region? No, denied as per the image below.
2. Was I able to deploy a new virtual machine called VM4 in ResourceGroup1 in the East US region? No, denied as per the image below.
Are you confused? 🙂
Are you thinking, I thought that adding a policy to ResourceGroup1 directly would override the Policy assigned to the Management Group level and allow me to build resources in East US region?
Or maybe you are thinking the opposite, that the policy assigned at the management group level would still take precedence/priority and allow a resource to be deployed to UK South but not East US.
Or maybe you’re thinking that it would be possible to build resources in ResourceGroup1 in both UK South and East US regions.
Or may be you knew what the result was going to be, in this case, I am not allowed to deploy to any of the regions.
Or you were thinking something else. In that case, please do drop a comment towards the end of this post to let us know.
Why was I not allowed to deploy to any of the regions This is because both polices are applying together and a deny takes precedence/priority. In this case, both policies are denying. The policy at the management level denies/restricts deployments to East US as it only allows deployments to UK South. The policy at the resource group level denies/restricts deployments to UK South region as it only allows deployments to East US. The most restrictive/deny policy will take effect, in this case both of them are restricting/denying deployments, therefore both policies apply and deny access. As per the diagram below,
Question 5 What would happen if you apply two policies but the same configuration to both Management Group and resource group. So allow deployments to UK South only scoped to the Management Group and allow deployments to UK South region only at the resource group? as per the image below.
Result You would be allowed to deploy to the UK South region as both policies are allowing at Management Group and Resource Group. In my case I removed the parameter of EAST US region at resource group level and added UK South. You may need to wait up to 30 minutes before new changes take effect.
The result, there was no error/warning when I selected UK South, as shown in the image below.
Question6 Could you exclude policies from being applied to certain resources? For example, VM1, VM2, VM3 which already exist in a resource group, or if I want to apply a policy but I want to exclude certain resources from the policy. Is this possible?
Answer Yes, you can exclude a subscription, resource group or specific resources so a Azure policy does not apply. There is an exclusions option.
Question7 The built in ‘allowed locations’ policy you used is denying you to deploy resources in the regions not specified in the Policy. Is there a deny setting somewhere that you have to enable?
Answer: The policy I used already is configured to deny, known as an effect. We can check this by accessing the JSON (Java Script Object Notation) code which is what the policy is using under the hood.
1. Go to Azure Policy 2. Click Assignments from the left pane under the section Authoring 3. Click the three dots … as shown in the image below
4. Click view definition (This will display the JSON code used under the hood, it is how the policy is compiled) 5. Scroll down to “effect”:
You can’t change the effect of a default/built in policy, the option to edit or delete built in policies/initiatives are greyed out. However, you can duplicate an existing definition, give it a new name and amend as required.
In this post I explain the configuration options available when configuring Virtual Network Peering in Azure. The post will mention Azure Virtual Networks, Azure VPN Gateway, Network Security Groups, Network Service Tags and User Defined Routes, however, these features will not be covered in this post. You can click the embedded links to learn more. The aim of this post is to explain the Virtual Network Peering configuration options only.
When configuring VNET (Virtual Network) peering in the Azure Portal, we come across the options below and we’ll take a look at the purpose of each one.
In my demo, I have named my Virtual Networks VNET1, VNET2 and VNET3.
Configuration option 1: Allow ‘VNET1’ to access ‘VNET2’
Explanation: This option is enabled by default and allows resources in VNET1 to communicate with resources in VNET2 over the Microsoft private network. If you disable this default option, resources in VNET1 cannot communicate with resources in VNET2, you’re basically disabling communication between the VNET’s.
Note: If you’re using Network Security Groups (NSG) which are used to allow and deny inbound and outbound traffic, the default VirtualNetwork service tag inside a Network Security Group (NSG) allows Virtual Network and peered traffic by default, therefore, communication between VNET1 and VNET2 could be blocked if you deny the default traffic inside an Network Security Group (NSG).
Configuration option 2: Allow ‘VNET1’ to receive forwarded traffic from ‘VNET2’
Explanation:
This option is not enabled by default.
To explain the purpose of this configuration I have drawn a diagram. In the drawing below VNET1 is peered to VNET2 and VNET2 is peered to VNET3.
If we enable this option on VNET1 (Allow ‘VNET1’ to receive forwarded traffic from ‘VNET2’), this means that VNET1 can receive traffic from VNET3. The traffic which flows through an NVA (Network Virtual Appliance) deployed in VNET2 is forwarded from VNET2 to VNET1. The blue line below represents traffic from VNET3 flowing through the NVA located in VNET2 and forwarded to VNET1.
Note: this option is only enabling the capability and does not automatically create an Network Virtual Appliance (NVA) or a User Defined Route (UDR) for you. You will need to create these as separate tasks.
I’ll be covering the last two options (options 3 and 4) together as they relate to each other.
Configuration option 3: Allow gateway in ‘VNET2’ to forward traffic to ‘VNET1’
Note: This option is enabled on VNET2 settings as shown in the image below
Configuration option 4: Enable ‘VNET1’ to use ‘VNET2’s’ remote gateway
Note: This option is enabled on VNET1 settings as shown in the image below
Explanation:
Both options are not selected by default.
Firstly, Option 4 (Enable ‘VNET1’ to use ‘VNET2’s’ remote gateway can only be enabled if ‘VNET2′ has a remote gateway. By enabling this option we are allowing VNET1 to use the remote gateway in VNET2’. Let’s dig deeper to understand this further.
You would enable this option if you have implemented a Gateway and required traffic to flow through this appliance. For example, VNET2, the Virtual Network you’re peering with has a Azure VPN gateway that enables communication to an on-premises network. You would need to enable this option to instruct VNET1 to use the VPN gateway (located in VNET2) if traffic needs to flow to on-premises. A user defined route would need to be created to facilitate the communication alongside this option. A User Defined Route (UDR) is not automatically created.
Once the above configuration is enabled, there is another requirement. This is where Option 3 comes in. However, we don’t enable this option in the configuration of VNET1, but it’s configured in VNET2 settings. Let me explain further below.
When we create a VNET peering, the peering wizard in the portal creates two VNET peering’s. One from VNET1 to VNET2 and one back from VNET2 to VNET1. As shown in the image below. There are two peering link names.
In this example, lets assume that a Azure VPN Gateway has been deployed in VNET2, which is the virtual appliance connecting to our on-premises network. Because the VPN Gateway resides in VNET2, I would configure the option, ‘Enable ‘VNET1’ to use ‘VNET2’s’ remote gateway’ in VNET1 settings. That’s where the first arrow in the image below points to.
In VNET2 settings which is peering back to VNET1, I configure the option, ‘Allow gateway in ‘VNET2’ to forward traffic to ‘VNET1’. This setting will allow ‘VNET1’ to receive forwarded traffic from ‘VNET2’s’ VPN gateway. Again, a reminder that ‘VNET2’ must contain a gateway in order for this option to be enabled.
Now, if resources in VNET1 required to communicate with the on-premises network, the traffic from VNET1 would be allowed to flow through the VPN Gateway located in VNET2 and down to on-premises. And traffic flowing from the VPN Gateway located in VNET2 would be able to communicate with resources in VNET1 forwarded through the VPN Gateway, for example traffic coming from on-premises, Site-to-Site (S2S) or a Point-to-Site (P2S) VPN could flow through the VPN Gateway and access VNET1. As mentioned earlier you would still need to create a User Defined Route (UDR) to route the traffic accordingly. Let me demonstrate this via a diagram below.
The diagram below shows,
– The option ‘Allow gateway in ‘VNET2′ to forward traffic to VNET1’ enabled on VNET2 – The option ‘Enable‘VNET1’ to use ‘VNET2’s’ remote gateway configured’ enabled on VNET1
The diagram shows that traffic flowing from on-premises or a Point-to-site (P2S) VPN through the Azure VPN Gateway located in VNET2 could reach VNET1 if needed, and traffic from VNET1 could use the VPNGateway in VNET2 to reach on-premises.
I hope the above drawings and explanations help. If you have any questions or feedback please feel free to comment below. See you at the next post. Thanks for tuning in.
Want to get started with Azure AI (Artificial Intelligence?
The free AI-900 learning path at Microsoft Learn is a great way to get started with Azure AI (Artificial Intelligence) and prepare for the exam. The exam is an opportunity for you to demonstrate knowledge of machine learning and AI (Artificial Intelligence) concepts and related Microsoft Azure services. Artificial Intelligence (AI) enables us to build amazing software that can improve health care, enable people to overcome physical disadvantages, empower smart infrastructure, create incredible entertainment experiences, and even save the planet! However, we need to build responsibly to ensure we don’t build AI solutions which are biased towards specific group of people.
In today’s world, we create huge volumes of data as we go about our daily lives. From the text messages, emails, and social media posts we send to the photographs and videos we take on our phones, we generate massive amounts of information. More data is created by millions of sensors in our homes, cars, cities, public transport infrastructure, and factories.
Data scientists can use all of that data to train machine learning models that can make predictions and inferences based on the relationships they find in the data.
I would recommend you go through the Free Microsoft Learn content and the AI-900 free practice test questions available at Microsoft Learn to further strengthen your knowledge. This post is in no way a complete AI-900 study guide like the one available at Microsoft Learn, however it will give you an understanding of the different terms (there are a few to remember), such as regression, classification, clustering, bot service, AI Principles and more!
I have been preparing for the Azure Fundamentals (AI-900) certification recently and thought it would be a good idea to document notes on a blog post which will hopefully help others who are preparing for the exam. My aim is to keep the notes simple and straight to the point whilst giving you the information along with examples to understand the various Artificial Intelligence (AI) terms. I have personally ben through the AI-900 Microsoft Learn content and the official practice test questions.
Let’s get started 🙂
What is AI (Artificial Intelligence)? AI is software that imitates human behaviors and capabilities. It is like a super smart computer that can think and learn similar to a human being. Imagine it as a helpful robot friend that can do things just like us. AI can learn from the information around it, like humans do when we wish to learn new skills such as when we learn by reading a book or an online article. When we input data into a machine learning model we call this a dataset. The model can then use this information to make decisions.
What is a dataset? A dataset teaches the machine learning algorithm how to make predictions. A dataset could include, image data, video data, audio date, numeric data and text data. Imagine you’re working on a project to predict housing prices based on various features like square footage, number of bedrooms, and location. You may have a dataset containing historical housing data. Work is carried out on the data set to label it so the algorithm can understand what the outcome needs to be.
What isMachine Learning? Often known as the foundation of an AI System, this is the way we teach a computer model to recognise things by showing it examples. It can then use the information learned to make predictions. For example, a doctor may use clinical data from past patients to run automated tests that predict whether a new patient is at risk from diabetes based on factors like weight, blood glucose level, and other measurements. Or an owner of an ice cream shop might use an app that combines historical sales and weather records to predict how many ice creams they’re likely to sell on a given day, based on the weather forecast.
There are multiple types of machine learning including the ones shown in the diagram below. I’ll go through and explain each one below,
Supervised Machine Learning Supervised machine learning is a general term for machine learning algorithms in which the training data includes both feature values and known label values (more on features and labels shortly). The data has been labeled for training. Supervised machine learning is used to train models by determining a relationship between the features and labels in past observations, so that unknown labels can be predicted for features in future cases.
A couple words mentioned in the text above were features and labels. Let’s understand what these are,
Features: imagine a dataset about houses. Relevant features may include, size of house, number of bedrooms and location. Or you plan to use machine learning to predict the probability of humans developing diabetes based on their age and body fat percentage. Age and body fat percentage are features. Another example of features could be in the case of a company who is using machine learning to predict various aspects of its e-scooter hire service dependent on weather. The two attributes which are features could be weather temperature and weekday/weekend.
Labels: data labelling is the process of identifying our data and adding a label to allow a machine learning model to learn. Labels are the values we aim to predict using our model and represent an output, such as, price of the house. In the above example, where I mentioned that age and body fat percentage are features, the label would be the outcome, such as the likelihood of a patient developing diabetes would be the outcome. Also, in the above example where I discussed under features, I used the example of the e-scooter company, labels (output) could be number of hires and distance travelled.
As per the diagram above, regression, classification (binary classification and multiclass classification) fell under supervised learning. Let’s go through these options.
Regression Regression models are trained to predict numeric label values based on training data that includes both features and known labels. The label (output) predicted are numerical values. An example of regression is the stock market, aiming to figure out where stock prices are going to be in the future by looking at previous and current trends. Price is a numerical value. Or the number of ice creams sold on a given day, based on the temperature, rainfall, and windspeed. Number of ice creams, again a numerical value. Or the fuel efficiency (in miles-per-gallon) of a car based on its engine size, weight, width, height, and length. Or an energy utility company who wants to develop a mobile app for its customers to monitor their energy use and to display their predicted energy use for the next 12 months. Regression = numerical.
It is worth understanding the two regression types below,
– Multiple linear regression: For example, there is a requirement to identify numerical values that represent the probability of humans developing diabetes based on age and body fat percentage. Multiple linear regression models a relationship between two or more features and a single label, which matches the scenario in this item.
– Linear regression: Considers one independent variable to predict an outcome. For example, predicting house price based on square footage only. Using a single variable instead of multiple.
Classification
What are classifications? we could think of classifications in which the label represents a categorisation or class. For example, which students will pass or fail based on previous and current results, or values such as true or false, yes or no, and others.
There are two common classification scenarios,
– Binary classification Binary classification models predict one of two mutually exclusive outcomes. For example, whether a patient is at risk of diabetes based on clinical metrics like weight, age, blood glucose level, and so on, or whether a mailing list customer will respond positively to a marketing offer based on demographic attributes and past purchases, or whether a bank customer will default on a loan based on income, credit history, age, and other factors.
In all of these examples, the model predicts a binary true/false or positive/negative prediction for a single possible class.
– Multiclass classification Multiclass classification extends binary classification to predict a label that represents one of multiple possible classes. For example, working out if a movie is comedy, horror, adventure or sci-fi based on who stars in the movie, the director and the budget. In this classification we are handling multiple classes of movies and predicting whether they are comedy, horror and so on.
Unsupervised machine learning
Unsupervised machine learning involves training models using data that consists only of feature values without any known labels. Unsupervised machine learning algorithms determine relationships between the features of the observations in the training data. We discussed supervised learning earlier and we know that the model will output a label of whether the movie is horror, adventure, sci-fi and so on. That was supervised learning, hold that thought.
Now imagine you have a objects with no labels. You don’t know what they are. Unsupervised learning is all about discovering hidden patterns and organising things when you don’t have clear labels. It’s like solving a fun puzzle! The model has feature values, for example, size of house, number of bedrooms and locations but there are no labels or output values specified.
With unsupervised machine learning, labels are not produced by humans, the Machine Learning model does its own labelling, whereas with supervised machine learning models, humans create labels to allow the machine learning model to learn.
The most common form of unsupervised machine learning is clustering as shown in the diagram I posted above,
Clustering A clustering algorithm identifies similarities between observations based on their features, and groups them into discrete clusters. For example, the grouping of similar flowers based on their size, number of leaves, and number of petals. Or imagine having a box of toys, but you don’t know which toys belong together because they have not been labeled. You would look at the toys and look for similarities such as all the red cars in one pile, all the blue balls go in one pile and so on. Each pile is a cluster. The goal of clustering is to find patterns and group similar toys together. Another example, a retailer wants to group together online shoppers that have similar attributes to enable its marketing team to create targeted marketing campaigns for new product launches. Clustering = grouping.
Anomaly Detection What is anomoly detection? you may have experienced using your credit card abroad and being blocked. This is an example of an anomaly detection, as the process of using the credit card abroad triggers an alert to your bank of a possible suspicious activity. Another example, an AI workload which relies on sensors to proactively detect an upcoming failure of electronic equipment. Anomaly detection can analyse data collected in the past to identify errors or unusual changes in the present and future. To put this simply, it’s detecting things which are out of place.
Deep Learning
Deep learning is an advanced form of machine learning that tries to emulate the way the human brain learns. Just like humans, deep learning models learn from examples. Imagine a human learning to recognise animals. We see lots of pictures of cats, dogs, and elephants. Over time, we start recognising them by their features. Similarly, deep learning models look at tons of data (like images, text, or sounds) and learn patterns. However, Humans learn from a mix of experience, intuition, and reasoning. We understand context, emotions, and cultural nuances. Deep learning models don’t have feelings or intuition. They learn purely from mathematical patterns in data. Instead of one layer of understanding (like a single thought), deep learning uses neural networks with many layers. These layers help the model learn complex patterns. So, while deep learning mimics some aspects of human learning, it’s more like a super smart calculator that crunches numbers.
The aim of Neural Networks is to try and resemble how the brain works, but in this case a neuron represents an algorithm. Data is inputted into a neruron and based on what the output is, the data will be passed to one or many other connected neurons. The AI-900 learning path explains how a neural network learns
Computer Vision (Azure AI Vision) What is computer vision? It makes decisions based on inputs such as through cameras, images and videos. For example, how many people are there in an image. How many people are wearing the colour blue. Is this an apple or orange. How many people are wearing sunglasses. Describe what is included in an image, for example, you could take a picture on your phone via an app which tells you what is in your surrounding area (a great example is the free SeeingApp from Microsoft, give it a try).
Furthermore, computer vision could detect the presence or movement of people. Azure AI Vision Spatial Analysis is a powerful service that allows you to analyse video streams from cameras and extract valuable insights related to people’s presence and movements. For example, how many people are in a shop right now, how many people entered a shop, are people wearing masks or is social distancing taking place. After people are detected, the system can track the people as they move around over time.
You may be thinking, how does the App know what is in the surrounding area based on a photo? how does it know how to recognise objects? Great question. It is based on common computer vision tasks which include,
– Image classification: this process involves training a machine learning model to classify images, for example you may classify different types of vehicles, a bus, car, cyclist, train.
– Object detection: For example a CCTV system which detects what types of vehicles are on the road in real time, such as marking the object as a bus, car or cyclist.
– Semantic segmentation: Imagine an image containing various car models. Semantic segmentation will recognise that all the cars belong to the same class, in this case a car. It detects individual pixels in the image and can highlight all cars with the colour blue which indicates that these vehicles are cars. Buses could be highlighted as red, indicating this is a bus and so on. The pixels of the image are coloured by the AI model.
– Image analysis: For example, analysing an image and providing an output via voice, “a person with a dog on a street”. A great example of this is the free Microsoft SeeingApp.
– Face detection, analysis, and recognition: a form of object detection which locates human faces in an image.
– Optical character recognition (OCR): this is a technique used to detect and read text in images. For example, road signs, signs on a store front or extract information from scanned documents.
That’s the computer vision tasks covered, however something else to know is Azure AI Custom Vision,
Azure AI Custom Vision What is Azure AI Custom Vision? Azure AI Custom Vision is an image recognition service that allows you to build and deploy your own image models. The Custom Vision service uses a machine learning algorithm to analyse images. You submit sets of images that have and don’t have the visual characteristics you’re looking for. Then you label the images with your own custom labels (tags) at the time of submission. The algorithm trains to this data and calculates its own accuracy by testing itself on the same images. Imagine you need a special tool to recognise something unique, like whether people are wearing hard hats. Custom Vision lets you create your own tool for this specific job. You collect pictures of people with and without hard hats and teach your tool to recognise them. It’s like having a custom made solution just for you. Whereas “non-custom” vision include ready made tools that can recognise common things, like identifying cats or dogs.
Natural Language Processing Natural language processing (NLP) is the area of AI that deals with creating software that understands written and spoken language. It can allow you to create software that can analyse and interpret text in documents, email messages and other sources. This workload includes,
1. Language (Azure AI Language) Understand text. For example, Sentiment Analysis which can detect how happy or sad the writer is based on what language they use when writing. For example, you own a website selling t-shirts. A customer leaves a product review which is detected as a negative review based on the wording used in the review which indicates the customer is frustrated and not happy. The manager could be notified and take action, such as to contact the upset customer.
2. Translator Used to translate text, for example to translate text from English to Spanish like translator apps we use online.
3. Speech (Azure AI Speech)
There are two capabilities of speech,
– Speech Synthesis: Text to Speech. For example, software reading out text aloud.
– Speech Analysis: Speech to Text. For example captions on a video, like what we see on YouTube videos or when we are in a Microsoft Teams meeting we can switch on captions so whatever the presenter is saying is translated to text for people to read on the screen.
4. Bot service A chat bot on a website which can answer customer questions visiting a website and seeking help. Yes, that automated web chat most of us may have come across when visiting a third party website seeking help, for example a query on your energy or mobile bill.
Document Intelligence (Azure AI Document Intelligence) What is document intelligence? For example scanning documents such as receipts, invoices, tax forms and more, then extracting the information.
Knowledge Mining(Azure AI Search) What is knowledge mining? Extracting information from large amounts of information and creating a searchable knowledge store.
Generative AI (Azure OpenAI service) Generative AI can create original content, such as creating you a story, poems, images, code, writing a book and more. For example, you could ask it to create you a unique image of a dog riding a bike, wearing a helmet whilst on the moon. Bad example, I know, but I hope you get the point.
Understanding AI Principles
AI can be very powerful and can benefit the world. However, it must be used responsibly. There are challenges and risks which an application developer needs to take into account depending on the type of AI application. For example, an autonomous vehicle capable of sensing its environment and operating without a human. What if the vehicle experiences a system failure and causes a collision. Or a medical diagnostic bot is trained to use sensitive patient data but the data is not stored securely. Or a home automation assistant which provides no audio output to visually impaired users. Or a innocent person is convicted of a crime based on evidence from facial recognition. Or a loan approval model discriminates by gender due to bias in the data with which it was trained. There are many more examples, but you hopefully get the point.
At Microsoft, AI software development is guided by a set of six principles, designed to ensure that AI applications provide amazing solutions to difficult problems without any unintended negative consequences. These include,
Fairness – AI systems should treat people fairly without being bias. This bias could be based on gender, ethnicity or other factors targeting specific groups of people. For example you create a machine learning model to support a loan approval application. The model should predict whether the loan should be approved or denied without bias. Within Azure Machine Learning, there is a feature for model interpretation. It allows data scientists to assess how individual data features impact the model’s predictions. This capability is crucial for detecting and addressing any bias present in the model. Another example of Microsoft’s implementation of Responsible AI is with the Face service, which retires facial recognition capabilities that can be used to try to infer emotional states and identity attributes. These capabilities, if misused, can subject people to stereotyping, discrimination or unfair denial of services.
Reliability and Safety – AI systems should perform reliably and safely. Imagine a machine learning model which diagnoses patient symptoms and recommends prescriptions. What if this model was not reliable? patients could be issued the incorrect prescription which could be life threatening. Therefore, it is important that AI based application development goes through strict/rigorous testing to ensure it is reliable and safe before moving to production.
Privacy and Security – AI systems should be secure and respect privacy. We know that the machine learning models rely on large amounts of data. This data may contain personal details that must be kept private and stored securely.
Inclusiveness – AI systems should empower everyone and engage people regardless of physical ability, gender, sexual orientation, ethnicity, or other factors. For example, don’t leave out people with a visual impairment. Ensure the application works for all.
Transparency – AI systems should be understandable. Users need to be informed about the system’s purpose, functionality, and potential limitations.
Accountability – The people who develop solutions should be accountable for AI systems. Designers and developers of AI driven solutions should operate within a governance framework and organisational guidelines that uphold well defined ethical and legal standards. Accountability defines the framework of governance and organisational principles, which are meant to ensure that AI solutions meet ethical and legal standards that are clearly defined.
Are Machine Learning tools available in Azure or do we need to build the machine learning services from scratch?
No, you don’t need to build machine learning services from scratch. Azure AI services are a portfolio of AI capabilities that unlock automation for workloads in language, vision, intelligent search, content generation, and much more. They are straightforward to implement and don’t require specialist AI knowledge. Organizations are using Azure AI services in innovative ways, such as within robots to provide life-like companionship to older people by expressing happiness, concern, and even laughter. In other use cases, scientists are using AI to protect endangered species by identifying hard-to-find animals in images. This was previously time-consuming and error prone work, which the Azure AI Vision service can complete quickly and with a high degree of accuracy, freeing scientists to do other work. These pre built services can be added into web or mobile applications.
Two types of Azure AI Resources
Azure AI services are cloud-based, and like all Azure services you need to create a resource to use them. There are two types of AI service resources: multi-service or single-service.
multi-service resource: a resource created in the Azure portal that provides access to multiple Azure AI services with a single key and endpoint
Single-service resources: a resource created in the Azure portal that provides access to a single Azure AI service, such as Speech, Vision, Language, etc. Each Azure AI service has a unique key and endpoint. These resources might be used when you only require one AI service or want to see cost information separately.
Are there any YouTube videos you would recommend for preparing for the AI-900 certification?
Yes, there are many. I have listed a few below. Take a look to find out which one fits your learning style. Or search for others on YouTube.
Is there a Microsoft Study guide that I can go through?
Imagine you are joining a new company called Woodgrove and they need you to provide them with proof of your university degree, passport, driving license and other personal information. In the past and still continuing today we are having to send our personal documents to an employer or third party via email, upload through a website or via post. These companies carry out background checks to ensure the documentation is genuine and the process can take weeks or months.
What if Woodgrove allows you to gain discounts on new hardware such as laptops and monitors from a third party hardware provider, however, you need to prove that you are an employee of Woodgrove before the discounts are applied. Wouldn’t it be easy if you could easily verify that you work for Woodgrove in minutes and gain access to employee discounts? instead of having to send them your employee ID and photo ID.
Or what if an employer requires that you hold certain security certifications before allowing you access to an internal sensitive application? it would be great if you could verify that you hold the required certification without having to send the certificate to the employer and then waiting for approval which could delay your access to the internal application.
What about your personal data? As the owner of those personal documents,
we have no idea how the documents are stored
is the documentation stored in a secure location?
what if the documents are stolen? such as the company is hacked or even stolen by an internal employee?
is your data deleted after verification or is the company holding onto the documents for years?
how do we get the documents back and ensure they are deleted?
we have no control over our personal information. Our identity and all our digital interactions are owned and controlled by other parties, in some cases, even without our knowledge.
How do we keep track of who we shared our identity information with?
Organisations are facing constant pressure to keep our personal identity information safe and carrying out checks to ensure the documentation is genuine can take time, costing organisations money.
What if there was a better way? A secure way to store and get our personal documents verified quickly.
Introducing Microsoft Entra Verified ID. Entra Verified ID is a decentralised Identity service that lets you create a digital identity that you can use to prove your qualifications and identity online. For example, you can use this service to share only the information that your new employer needs, and nothing more. It’s basically a copy of your paper based identity copied into a secure digital version that you can store on your mobile phone.
These certificates are like digital versions of your diplomas, ID cards, or certificates. They are issued by trusted organisations that can verify your education and identity. You can choose which certificates or Identity information you want to show to your new employer, and they can trust that they are authentic and valid because they have been verified by an authorised company. They do not need to hold a copy of your certifications, passports and so on.
Microsoft Entra Verified ID is based on open standards that anyone can use and verify. It gives you more security and privacy over your identity data.
Using Microsoft Entra Verified ID can benefit both the employee and the employer in many ways, such as:
The employee can save time and hassle by not having to send or show their documents via email, mail, or in person. They can also avoid sharing more information than necessary, or risking losing or damaging their documents.
The employer can save time and money by not having to check or verify the documents manually or through costly third-party services. They can also reduce the risk of fraud, identity theft, or human error.
Both the employee and the employer can enjoy a smoother and more secure hiring process, and build trust and confidence with each other. They can also comply with the legal and regulatory requirements for identity and background verification.
It’s great for staff working remotely as staff don’t have to travel to the office carrying personal documents.
Organisation and employee can both revoke the credentials. For example when an employee leaves a company.
Furthermore, as an individual your identity remains secure, not easy to forge or hack and difficult for someone to impersonate you. You always have access to your secure digital identity and are able to recover it. Most importantly you are able to see logs of all the times you have used your digital identity, who you used it with and what it was used for. You are in control, and have the option to only disclose the specific information necessary to support the consented use.
You can also designate trusted friends and family members who can access your digital identity as needed if there was a need to do so, for example, if you are critically ill.
You as an individual control your identity and the company can confirm the identity you provide from your digital wallet is verified instantly without having to wait for weeks.
How does Verifiable Credentials work?
The below diagram provides an overview of how Verifiable Credentials work.
Example 1: Let’s use an example to explain the process further. An individual named Andrew accepts a job offer at a company called Woodgrove. Prior to joining the company, Andrew must go through a pre-onboarding process where he needs to verify his Identity. The company he is working for use Microsoft Entra Verified ID.
Andrew uses the Microsoft Authenticator App on his phone to verify his ID via the Woodgrove’s company portal. He takes a selfie of himself via his phone using the Microsoft Authenticator app and is requested to provide a copy of an ID with a photo. The company uses a trusted organisation connected to their portal/Microsoft Entra Verified ID Portal to verify the selfie matches the passport. This process is computerised and verifies the photo and passport within seconds. Andrew now receives a validated verified ID which is stored in his digital wallet, in this case the Microsoft Authenticator App on his mobile phone. Andrew can now use this newly created digital identity (e.g. a digital passport) from his phone to prove his identity to his new employer and to remotely access and setup a new logon account on his first day at work. In the process Andrew has not had to pass on a copy of his Identity to prove that he is a new employee of Woodgrove, as his identity was validated by a trusted identity provider who the employer also trusts.
Example 2: To explain how Verified Credentials work in a second example, we use a scenario that involves these actors:
Woodgrove Inc, a company that employs an individual named Alice.
Proseware, a company that gives discounts on hardware such as laptops to Woodgrove employees.
Alice, a Woodgrove employee who wants to benefit from Proseware’s discounts.
Currently, Alice signs in to Woodgrove’s network with a username and password. Woodgrove have implemented Microsoft Entra Verified Identity to make it easier for Alice to prove her employment status. Proseware accepts verifiable credentials issued by Woodgrove as valid evidence of employment that can grant access to their corporate discount program.
Alice asks Woodgrove for a verifiable credential that confirms her employment. Woodgrove Inc verifies Alice’s identity via secure third party and issues a signed verifiable credential (in seconds) that Alice can receive and store in her digital wallet app which proves that she is an employee of Woodgrove. Alice can now use this verifiable credential as a proof of employment on Proseware’s website. After a successful verification of the credential, Proseware’s website displays discounted rates for all hardware to Alice and the transaction is recorded in Alice’s wallet app so that she can keep track of where and to whom she shared her proof of employment verifiable credential.
Demo– Microsoft Entra Verifiable ID
Let’s go further and demo the process via Microsoft Entra Verifiable ID.
This demo illustrates a new remote employee at Woodgrove being onboarded before they’re ready to start their first day on the job. A new employee would be required to go into the office, fill out forms and receive a laptop. However, the company has adopted cutting edge technology to streamline onboarding and discounted equipment purchases.
Let check out what the process looks like with Microsoft Entra Verified ID.
Woodgrove have a portal configured to use Microsoft Entra Verified ID. Setup and configuration links are listed towards the end of this post.
Andrew Doe visits the portal as a new employee of Woodgrove
3. Andrew types his first name and last name. He then clicks the next button
4. A trusted Identity provider named True Identity will verify Andrew’s Identity. Andrew clicks the button Verify with True Identity.
5. Andrew types his name again. First name and Last name.
6. Andrew clicks the button, Take a selfie and takes a photo of himself
7. Selfie taken. Andrew now clicks Upload a government issue ID such as his passport.
8. Andrew clicks Next
9. The true Identity solution, a trusted third party will verify Andrews selfie (photo) and Passport. This process is computerised and happens in seconds. Verification Complete. Andrew clicks ok and then clicks next.
10. Now that the identity has been verified by True Identity, Andrew can scan the QR code displayed on the Woodgrove portal and store a digital Identity of his passport in his Microsoft authenticator app installed on his mobile phone. To scan the QR Code, Andrew opens the Authenticator App on his phone, clicks the option Verified ID’s located towards the bottom right corner of the app.
11. He clicks the option Scan QR code
12. He scans the provide QR code and enters a pin in his Authenticator App. He clicks add on his authenticator app and clicks next.
13. A Digital Verified ID (digital version of Andrew’s passport) has been successfully issued to Andrew and is stored on his phone. Andrew clicks return to Woodgrove.
A reminder that at this point Andrew has a verified digital identity of his passport stored on his mobile phone. This identity was validated by a trusted party selected by Woodgrove to perform the automated computerised checks.
14. Now Andrew Doe will onboard as a new employee of WoodGrove and provide his digital verified ID (Digital Passport) to WoodGrove to prove his identity. Andrew clicks the option, Access Personalized portal. A QR code appears, Andrew must prove his identity to WoodGrove. Continue to step 14.
15. Now that Andrew has a verified Digital ID (passport) on his phone, Andrew can use the Verified ID to scan the QR code and prove his identity to Woodgrove who is his new employer. Andrew clicks Verified IDs in his Authenticator App and scans the QR code on the screen. He clicks Share.
16. Andrew clicks the button continue onboarding
17. Success, Andrew has completed the verification process and gained access to the WoodGrove Employee portal. He has proved his identity and can now continue to retrieve a second Verified digital ID to prove that he is an employee of Woodgrove. He can later use this employee verified ID to order a laptop at a discounted rate. A benefit of being an employee of Woodgrove.
Andrew clicks, Retrieve my Verified ID
18. He scans the QR code visible on the screen using the authenticator app and types in the pin when requested. He clicks add.
19. Andrew now has two digital identities in his Authenticator App. One is his digital passport verified ID and another which proves that he is an employee at Woodgrove.
20. Time to order a laptop as an employee of Woodgrove. Andrew clicks, Visit Proseware which directs him to a third party website.
21. There is a problem for now. Andrew sees hardware prices at the full price and not the discounted rates. Andrew clicks Access discounts.
22. He clicks the option Verify my Employee Credential. Andrew must use his stored digital Woodgrove employee Verified ID to prove that he is an employee of Woodgrove. He clicks Verify my employee Credential.
23. He scans the QR code presented to him using his authenticator app. He clicks the option Select a Verified ID and picks the Verified Employee ID stored in his Authenticator App. He clicks confirm and clicks share.
24. That’s it. The verified ID which proves Andrew is an employee at Woodgrove has been applied and he can now see discounted prices on all hardware. There was no requirement to prove that Andrew is a Woodgrove employee by providing Proseware his employee ID or a picture of his company badge. The process was easy and quick.
If you are wanting to setup Microsoft Entra Verified ID into a website/portal, the setup documentation is available via the Microsoft Learn website at the links below,