Jump to content

proximagr

Moderators
  • Posts

    2468
  • Joined

  • Last visited

  • Days Won

    12

Blog Entries posted by proximagr

  1. proximagr
    <h1><strong>AzureRm | Create Site to Site VPN</strong></h1>
    <p>This post is part of a general idea, to create an end-to-end high available application infrastructure solution in Azure using internal load balancer with the new AzureRm commands and Azure PowerShell v.1.0 preview.</p>
    <p>We will create a Gateway, request a Public IP and establish a Site to Site VPN. At the time I am writting this post there is no option to create the VPN ising the Portal, the only way is using PowerShell. Also there is no option to download the configuration for the local firewall/router, like the classic deployment.</p>
    <p>The AzureRm commands are installed directly from the PowerShell using the Install-Module AzureRM & Install-AzureRM commands.</p>
    <p>So lets start:</p><pre class="crayon-plain-tag">#Login
    Login-AzureRmAccount
     
    #Create Gateway for VPN
     
    # add the local (office) public ip and local networks
    $resourcegroupName ="RMDemoRG"
    $locationName ="West Europe"
    $vnetName = "NRPVnet"
    New-AzureRmLocalNetworkGateway -Name localsite -ResourceGroupName $resourcegroupName -Location $locationName -GatewayIpAddress "XXX.XXX.XXX.XXX" -AddressPrefix @('10.0.0.0/24','192.168.0.0/24')
     
    # Create the Gateway Subnet
    $vnet = Get-AzureRmVirtualNetwork -ResourceGroupName $resourcegroupName -Name $vnetName
    Add-AzureRmVirtualNetworkSubnetConfig -Name 'GatewaySubnet' -AddressPrefix 172.16.0.0/16 -VirtualNetwork $vnet
    Set-AzureRmVirtualNetwork -VirtualNetwork $vnet
     
    # create gateway and request azure public ip
    $gwpip= New-AzureRmPublicIpAddress -Name RMDemoPIP -ResourceGroupName $resourcegroupName -Location $locationName -AllocationMethod Dynamic
    $vnet = Get-AzureRmVirtualNetwork -Name $vnetName -ResourceGroupName $resourcegroupName
    $GWsubnet = Get-AzureRmVirtualNetworkSubnetConfig -Name 'GatewaySubnet' -VirtualNetwork $vnet
    $gwipconfig = New-AzureRmVirtualNetworkGatewayIpConfig -Name gwipconfig1 -SubnetId $GWsubnet.Id -PublicIpAddressId $gwpip.Id
    New-AzureRmVirtualNetworkGateway `
    -Name RMDemoGW `
    -ResourceGroupName $resourcegroupName `
    -Location $locationName `
    -IpConfigurations $gwipconfig `
    -GatewayType Vpn `
    -VpnType PolicyBased #PolicyBased For Static & RouteBased for Dynamic VPN
     
    # Get the Public IP
    Get-AzureRmPublicIpAddress -Name RMDemoPIP -ResourceGroupName $resourcegroupName
     
    # Establish the VPN connection
    $gateway1 = Get-AzureRmVirtualNetworkGateway -Name RMDemoGW -ResourceGroupName $resourcegroupName
    $local = Get-AzureRmLocalNetworkGateway -Name LocalSite -ResourceGroupName $resourcegroupName
    New-AzureRmVirtualNetworkGatewayConnection `
    -Name localtovpn `
    -ResourceGroupName $resourcegroupName `
    -Location $locationName `
    -VirtualNetworkGateway1 $gateway1 `
    -LocalNetworkGateway2 $local `
    -ConnectionType IPsec `
    -RoutingWeight 10 `
    -SharedKey 'ABCDEFG1234567890'
     
    #check the VPN status
    Get-AzureRMVirtualNetworkGatewayConnection -Name localtovpn -ResourceGroupName $resourcegroupName -Debug</pre><p>Finally, since there is no way to download the configuration script at this time, the sample configurations can be found here: <a href="https://github.com/Azure/Azure-vpn-config-samples"target="_blank">https://github.com/Azure/Azure-vpn-config-samples</a></p>
    <p>After the creation of the VPN, that can be done only using PowerShell, we can use the portal to view the status and the settings</p>
    <p><a class="a2a_button_email" href="http://www.addtoany.com/add_to/email?linkurl=http%3A%2F%2Fwww.e-apostolidis.gr%2Fmicrosoft%2Fazurerm-create-site-to-site-vpn%2F&linkname=AzureRm%20%7C%20Create%20Site%20to%20Site%20VPN"title="Email" rel="nofollow" target="_blank"><img src="http://www.e-apostolidis.gr/wp-content/plugins/add-to-any/icons/email.png" width="16" height="16" alt="Email"/></a><a class="a2a_button_print" href="http://www.addtoany.com/add_to/print?linkurl=http%3A%2F%2Fwww.e-apostolidis.gr%2Fmicrosoft%2Fazurerm-create-site-to-site-vpn%2F&linkname=AzureRm%20%7C%20Create%20Site%20to%20Site%20VPN" title="Print" rel="nofollow" target="_blank"><img src="http://www.e-apostolidis.gr/wp-content/plugins/add-to-any/icons/print.png" width="16" height="16" alt="Print"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="https://www.addtoany.com/share#url=http%3A%2F%2Fwww.e-apostolidis.gr%2Fmicrosoft%2Fazurerm-create-site-to-site-vpn%2F&title=AzureRm%20%7C%20Create%20Site%20to%20Site%20VPN" id="wpa2a_2"><img src="http://www.e-apostolidis.gr/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>The post <a rel="nofollow" href="http://www.e-apostolidis.gr/microsoft/azurerm-create-site-to-site-vpn/">AzureRm | Create Site to Site VPN</a> appeared first on <a rel="nofollow" href="http://www.e-apostolidis.gr">Proxima's IT Corner</a>.</p>


    <a href="http://www.e-apostolidis.gr/microsoft/azurerm-create-site-to-site-vpn/"class='bbc_url' rel='nofollow external'>Source</a>
  2. proximagr
    AzureRm | Create Internal Load Balancer with two VMs
    This post is part of a general idea, to create an end-to-end high available application infrastructure solution in Azure using internal load balancer with the new AzureRm commands and Azure PowerShell v.1.0 preview. For this solution I will use:
    2x Centos 11 sp4 Web/Application Servers 2x Centos 11 sp4 MySQL Servers 1x Gateway

    The first part is to create an Internal Load Balancer in Azure to use it for two VMs. This setup is ideal for Web server farms and also for SQL clusters. We will create the VNET with the Front End subnet, the internal load balancer and finally two VMs behind the load balancer. The result will be something like the below image.

    In order to run the new AzureRm commands we need to have the Windows Management Framework 5.0 Production Preview. If you have Windows 10 then no action is needed since it is embeded. For Windows 7-8.1 we can download it here: https://www.microsoft.com/en-us/download/details.aspx?id=48729
    The AzureRm commands are installed directly from the PowerShell using the Install-Module AzureRM & Install-AzureRM commands.
    Read more: http://www.e-apostolidis.gr/microsoft/azurerm-create-internal-load-balancer-with-two-vms/
  3. proximagr
    Auto Start/Stop an Azure VM (ARM)
    For Azure VMs that are not needed to be running 24/7, we can use Azure Automation to schedule automatic Stop (Deallocate) and Start. First ensure to reserve resources if needed, such as the Private and the Public IP.
    Now lets see how we will Auto Start/Stop an Azure VM (ARM). First create an Automation Account, go to the Azure Portal, expand more services and search for automation. Then click the “Automation Accounts”

    At the Automation Accounts press “Add”

    At the Automation Account creation blade provide a Name, the Subscription, the Resource Group, trhe location and if it is the first Automation Account select Yes to create automatically a Run As account

    After the creation it will open the new Automation Account’s blade. Here click the “Runbooks”

    We don’t need to write any scripting since there are available Runbooks at the gallery, so select Browse gallery

    At the Gallery search for the “Start Azure V2 VMs” and “Stop Azure V2 VMs” Graphical Runbooks.


    Click the Runbook and a the new blade press Import. Type a unique name and press OK

    After the import, we will be navigated to the Runbook and we need to Publish it in order to be able to use it. At the Runbook’s blade, press “Edit”

    And then press Publish

    After the Publishing the Runbook is ready to Start and add Schedules. Now lets add Schedules to specify the VM and the schedule that will Start. Press “Schedule”

    Press Link a schedule to your runbook and then Create a new schedule

    Give a name to the schedule, and then select the Start date and time and the recurrency, at my example it will start the VM everyday at 7:00 am

    then go to the Parameters and provide the Resourcegroup name and the VM name and press OK.

    The Runbook is ready. Create more Schedules for all needed VMs. And then repeat the process for the “Stop Azure VM V2” runbook and you will have two Runbooks with many Schedules. To test a Runbook press “Start”.

     

    The post Auto Start/Stop an Azure VM (ARM) appeared first on Proxima's IT Corner.


    Source
  4. proximagr
    <h1>Auto-Shutdown Hyper-V free with USB UPS</h1>
    <p>Recently i installed a Hyper-V 2012 R2 server (the free version) but my UPS doesn’t support Windows Core. No problem, we have PowerShell!! after some search on various sites – blogs – etc i end up creating the following script. It checks the battery status every 3 minutes, using WMI and when the battery drops below 50% is sends the shutdown signal. As long as you set the VMs to save on shutdown you are OK!</p>
    <p>I also added a simple mail notification before the shutdown.</p><pre class="crayon-plain-tag">$batterystatus = (get-wmiobject -class CIM_Battery -namespace "rootCIMV2").EstimatedChargeRemaining
    DO
    {
    start-sleep -seconds 180
    $batterystatus = (get-wmiobject -class CIM_Battery -namespace "rootCIMV2").EstimatedChargeRemaining
    $batterystatus
    } While ($batterystatus -gt 50)
    $login = "username"
    $password = "password" | Convertto-SecureString -AsPlainText -Force
    $credentials = New-Object System.Management.Automation.Pscredential -Argumentlist $login,$password
    Send-MailMessage -Body "UPS Started - Server will shutdown in 5 minutes" -From [email protected] -To [email protected] -Subject "Power Loss - UPS Started" -SmtpServer mail.domain.com -Credential $Credentials
    shutdown /s /t 300</pre><p> </p>
    <p><a class="a2a_button_email" href="http://www.addtoany.com/add_to/email?linkurl=http%3A%2F%2Fwww.e-apostolidis.gr%2Fmicrosoft%2Fpowershell%2Fauto-shutdown-hyper-v-usb-ups%2F&linkname=Auto-Shutdown%20Hyper-V%20free%20with%20UPS"title="Email" rel="nofollow" target="_blank"><img src="http://www.e-apostolidis.gr/wp-content/plugins/add-to-any/icons/email.png" width="16" height="16" alt="Email"/></a><a class="a2a_button_print" href="http://www.addtoany.com/add_to/print?linkurl=http%3A%2F%2Fwww.e-apostolidis.gr%2Fmicrosoft%2Fpowershell%2Fauto-shutdown-hyper-v-usb-ups%2F&linkname=Auto-Shutdown%20Hyper-V%20free%20with%20UPS" title="Print" rel="nofollow" target="_blank"><img src="http://www.e-apostolidis.gr/wp-content/plugins/add-to-any/icons/print.png" width="16" height="16" alt="Print"/></a><a class="a2a_dd addtoany_share_save" href="https://www.addtoany.com/share#url=http%3A%2F%2Fwww.e-apostolidis.gr%2Fmicrosoft%2Fpowershell%2Fauto-shutdown-hyper-v-usb-ups%2F&title=Auto-Shutdown%20Hyper-V%20free%20with%20UPS" data-a2a-url="http://www.e-apostolidis.gr/microsoft/powershell/auto-shutdown-hyper-v-usb-ups/" data-a2a-title="Auto-Shutdown Hyper-V free with UPS"><img src="http://www.e-apostolidis.gr/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p><p>The post <a rel="nofollow" href="http://www.e-apostolidis.gr/microsoft/powershell/auto-shutdown-hyper-v-usb-ups/">Auto-Shutdown Hyper-V free with UPS</a> appeared first on <a rel="nofollow" href="http://www.e-apostolidis.gr">Proxima's IT Corner</a>.</p>


    <a href="http://www.e-apostolidis.gr/microsoft/powershell/auto-shutdown-hyper-v-usb-ups/"class='bbc_url' rel='nofollow external'>Source</a>
  5. proximagr
    Για πολλούς, ένα πρόβλημα στο να χρησιμοποιήσουν την Azure SQL, είναι η δημόσια πρόσβαση. Μετά τα τελευταία Azure updates μπορούμε να χρησιμοποιήσουμε τα service endpoints ώστε να ασφαλίσουμε την Azure SQL μέσα σε ένα VNET.
    Ας ξεκινήσουμε λοιπόν να βάλουμε την Azure SQL μέσα σε ένα VNET. Ανοίγουμε το Azure Portal και ξεκινάμε να δημιουργήσουμε ένα VNET. Στο τέλος της σελίδας δημιουργίας έχει προστεθεί μια νέα επιλογή που λέγετε service endpoints. Το ενεργοποιούμε και επιλέγουμε το Microsoft.Sql.

    Στη συνέχεια δημιουργούμε μια SQL Database. Πάλι από το Azure Portal επιλέγουμε New –> SQL Database και βάζουμε ότι στοιχεία θέλουμε.

     
    Αφού δημιουργηθεί η SQL Database, ανοίγουμε τις ρυθμίσεις και πηγαίνουμε στο Firewall / Virtual Networks. Εκεί απενεργοποιούμε το «Allow access to Azure Services». Με αυτήν την επιλογή κόβουμε την πρόσβαση στην SQL από την Public IP.
     

     
    Για να συνδέσουμε την SQL στο VNET πατάμε το «+Add existing virtual network» και δημιουργούμε έναν κανόνα όπου επιλέγουμε το VNET που δημιουργήσαμε με ενεργοποιημένα τα service endpoints.
     

    Η ώρα της δοκιμής. Ένας γρήγορος τρόπος να δοκιμάσουμε την συνδεσιμότητα μιας SQL είναι το «ODBC Data Source Administrator» το οποίο βρίσκετε στα Administrative Tools σε όλα τα λειτουργικά MS Windows Server & Professional clients. Αν προσπαθήσετε να συνδεθείτε over internet θα δείτε ότι η σύνδεση κόβετε σε επίπεδο TCP, δεν ανοίγει καν η σύνδεση, σαν να μην υπάρχει.
    Έφτιαξα λοιπόν ένα VM μέσα στο VNET για να έχω τοπική πρόσβαση. Ανοίγουμε το ODBC Data Source Administrator, και στα User DSN πατάμε new connection. Για όνομα δίνουμε ότι θέλουμε, δεν έχει σημασία και στο server δίνουμε το FQDN του Azure SQL Database.
     

     
    Στην επόμενη εικόνα δίνουμε username και password του Azure SQL Database και πατάμε «Test Data Source»
     

     
    Επίσης μπορούμε να συνδεθούμε με SMSS, βάζοντας το SQL Server FQDN, το username και το password
     

     
    και συνδέεται γρήγορα και με ασφάλεια!
     

     
    [/url]
    The post Ασφάλισε την Azure SQL Database μέσα σε ένα VNET χρησιμοποιώντας service endpoints appeared first on Apostolidis IT Corner.


    Source
  6. proximagr
    Azure Update Management
    Have you checked the update management system for your Azure and On-Premises server that supports both Windows and Linux operating systems? And it is completely free! Please find the full list of supported operating systems and prerequisites here: https://docs.microsoft.com/en-us/azure/operations-management-suite/oms-solution-update-management#prerequisites.
    Lets get started. The easiest way is to start from an Azure VM. Go to the VMs blade and find “Update management”. You will see a notification that the solution is not enabled.

    Click the notification and the “Update Management” blade will open. The “Update Management” is an OMS solution, so you will need to create a “Log analytics” workspace, you can use the Free tier. If you don’t have a Log analytics workspace the wizard will create a default for you. Also it will create an automation account. Pressing enable will enable the “Update Management” solution.

    After about 15 minutes, at the “Update Management” section of the VM you will see the report of the VM’s updates.

    After that process the Automation Account is created and we can browse to the “Automation Accounts” service at the Azure Portal. There click the newly created Automation Account and scroll to the “Update Management” section. There we can see a full report of all VMs that we will add to the Update Management solution. To add more Azure VMs simply click the “Add Azure VM” button.

    The Virtual Machines blade will open and will list all Virtual Machines at the tenant. Select each VM and press Enable.

    After all required VMs are added to the Update Management solution click the “Schedule update deployment” button. There we will select the OS type of the deployment, the list of computers to update, what type of updates will deploy and the scheduler. More or less this is something familiar for anyone that has worked with WSUS.

    Press the “Computers to Update” to select the Azure VMs for this deployment from the list of all VMs enabled.

    Then select what types of updates will deploy.

    If you want to exclude any specific update you can add the KB number at the “Excluded updated” blade.

    And finally select the schedule that the update deployment will run.

    Back to the “Update Management” blade, as we already said, we have a complete update monitoring of all Virtual Machines that are part of the “Update Management” solution.

    You can also go to the “Log Analytics” workspase and open the “OMS Portal”

    There, among other, you will see the newly added “System Update Assessment” solution.

    and have a full monitoring and reporting of the updates of your whole environment.

    [/url]
    The post Azure Update Management appeared first on Apostolidis IT Corner.


    Source
  7. proximagr
    Puppet On Azure
     
    Εγκατάσταση Open Source Puppet
     
    Βήμα 1 Σύνδεση στο Ubuntu
     
    ανοίγουμε έναν SSH client, στην προκειμένη περίπτωση PuTTY και δίνουμε για Host Name το Public όνομα του Cloud Service, στην προκειμένη περίπτωση openpuppetlab.cloudapp.net, δίνουμε την πόρτα 30021 που έχουμε ορίσει για το puppetmaster και πατάμε Open

    Κάνουμε login με το username & password που ορίσαμε στην δημιουργία του VΜ. Για να μην βάζουμε “sudo” σε κάθε εντολή, τρέχουμε “sudo su –“ και ενεργοποιούμε το root mode μέχρι να κάνουμε “exit”
     
    Βήμα 2 Προαπαιτούμενα
     
    Στατική IP
    Το Puppet χρειάζεται στατική IP & σταθερό hostname. Τη στατική IP την έχουμε ήδη ορίσει στο Azure, οπότε τρέχουμε ένα “ifconfig” για να δούμε ότι όντος το Ubuntu έχει αυτήν την IP

     
    Hostname
    Μετά ανοίγουμε το hosts file για να δώσουμε hostnames. Για τις ανάγκες του Lab θα χρησιμοποιήσω για domain name το puppet.lab. Η ίδια διαδικασία πρέπει να γίνει στο Master & στα Slaves με τις ίδιες εγγραφές.

    Αφού τελειώσουμε με τις εγγραφές πατάμε Ctrl-X, απαντάμε Y για να σώσει τις αλλαγές και Enter για έξοδο.
     
    Time Sync
    Το Puppet Master & τα Slaves πρέπει να έχουν συγχρονισμένη ώρα. Για να γίνει αυτό τρέχουμε την παρακάτω εντολή σε όλα τα μηχανήματα.
    ntpdate pool.ntp.org ; apt-get update && sudo apt-get -y install ntp ; service ntp restart

     
    Βήμα 3 Εγκατάσταση Puppet Master
    Ενεργοποιούμε το Puppet Laps repository και κάνουμε την εγκατάσταση με τις παρακάτω εντολές
    wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb
    dpkg -i puppetlabs-release-trusty.deb
    apt-get update
    apt-get install puppetmaster

    Τέλος τρέχουμε “puppet –V” για να σιγουρευτούμε ότι το Puppet τρέχει και τι version έχει εγκατασταθεί

    Είναι καλό σε αυτό το σημείο να κλειδώσουμε το Puppet Auto Update γιατί σε περίπτωση automatic update θα χαλάσει το configuration. Για να γίνει αυτό δημιουργούμε ένα αρχείο μέσα στο apt/preferences.d με όνομα 00-puppet.pref και βάζουμε τα παρακάτω δεδομένα:
    Δημιουργία αρχείου:
    # /etc/apt/preferences.d/00-puppet.pref
    nano /etc/apt/preferences.d/00-puppet.pref
    Δεδομένα:
    Package: puppet puppet-common puppetmaster-passenger
    Pin: version 3.8*
    Pin-Priority: 501
    Αφού τελειώσουμε με τις εγγραφές πατάμε Ctrl-X, απαντάμε Y για να σώσει τις αλλαγές και Enter για έξοδο.
    Ανοίγουμε με nano το αρχείο /etc/puppet/puppet.conf
    nano /etc/puppet/puppet.conf
    Και βάζουμε comment στο templatedir

    Αν δεν το κάνουμε αυτό θα πάρουμε αργότερα μήνυμα ότι το templatedir is deprecated

    Κάνουμε restart το pupetmaster service και είναι έτοιμο
    service puppetmaster restart
     
    Βήμα 4 Εγκατάσταση Puppet Slave
    ανοίγουμε έναν SSH client, στην προκειμένη περίπτωση PuTTY και δίνουμε για Host Name το Public όνομα του Cloud Service, στην προκειμένη περίπτωση openpuppetlab.cloudapp.net, δίνουμε την πόρτα 30022 που έχουμε ορίσει για το puppetslave01 και πατάμε Open

    Κάνουμε login με το username & password που ορίσαμε στην δημιουργία του VΜ
    Τρέχουμε τα προαπαιτούμενα από το Βήμα2
    Ενεργοποιούμε το Puppet Laps repository και κάνουμε την εγκατάσταση με τις παρακάτω εντολές
    cd /tmp
    wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb
    dpkg -i puppetlabs-release-trusty.deb
    apt-get update
    apt-get install puppet
    Τέλος τρέχουμε “puppet –V” για να σιγουρευτούμε ότι το Puppet τρέχει και τι version έχει εγκατασταθεί και ότι είναι ίδια με το version του Puppet Master

    κλειδώνουμε το Puppet Auto Update γιατί σε περίπτωση automatic update θα χαλάσει το configuration. Για να γίνει αυτό δημιουργούμε ένα αρχείο μέσα στο apt/preferences.d με όνομα 00-puppet.pref και βάζουμε τα παρακάτω δεδομένα:
    Δημιουργία αρχείου:
    nano /etc/apt/preferences.d/00-puppet.pref
    Δεδομένα:
    Package: puppet puppet-common puppetmaster-passenger
    Pin: version 3.8*
    Pin-Priority: 501
    http://www.e-apostolidis.gr/wp-content/uploads/2015/10/mopb11.jpg
    Αφού τελειώσουμε με τις εγγραφές πατάμε Ctrl-X, απαντάμε Y για να σώσει τις αλλαγές και Enter για έξοδο
    Το επόμενο βήμα για τους Slaves είναι να αλλάξουμε το configuration
    Ανοίγουμε με nano το αρχείο /etc/puppet/puppet.conf
    nano /etc/puppet/puppet.conf
    Και αλλάζουμε ως εξής:
    Βάζουμε comment στο templatedir & σε όλο το [master] section και δημιουργούμε ένα [agent] section όπου ορίζουμε τον Puppet Master server
    http://www.e-apostolidis.gr/wp-content/uploads/2015/10/mopb12.jpg
    Τέλος ενεργοποιούμε το Puppet Agent να ξεκινάει σαν service
    nano /etc/default/puppet
    και αλλάζουμε το START=no σε yes
    http://www.e-apostolidis.gr/wp-content/uploads/2015/10/mopb13.jpg
    Και ξεκινάμε το service με
    service puppet start
    http://www.e-apostolidis.gr/wp-content/uploads/2015/10/mopb14.jpg
     
    Βήμα 5 Certificates
    Σε αυτό το βήμα ήδη οι agents έχουν αρχίσει να ψάχνουν τον Puppet Master και του ζητάνε certificate exchange για να ξεκινήσουν να δέχονται οδηγίες. Οπότε το επόμενο βήμα είναι να κάνουμε sign τα certificates που έχουν έρθει από τους agents.
    Τρέχουμε στον Puppet Master το command “puppet cert list” για να δούμε τα certificates που έχουν έρθει για να γίνουν sign.
    http://www.e-apostolidis.gr/wp-content/uploads/2015/10/mopb15.jpg?w=625
    Βλέπουμε ότι οι δύο Puppet Slaves έχουν εμφανιστεί και ζητάνε για certificate sign. Για να κάνει ο Puppet Master sign τα certificates τρέχουμε:
    puppet cert sign puppetslave01.puppet.lab & puppet cert sign puppetslave02.puppet.lab
    http://www.e-apostolidis.gr/wp-content/uploads/2015/10/mopb16.jpg?w=625
    Τώρα αν ξανατρέξουμε το “puppet cert list” πρέπει να μην φέρνει κανένα request
    Και τρέχοντας το “puppet cert list -all” θα πρέπει να φέρει το certificate του Master και τα 2 certificates των slaves και το + μπροστά από την κάθε εγγραφή υποδεικνύει ότι έχει γίνει sign επιτυχώς και είναι ενεργό.
    http://www.e-apostolidis.gr/wp-content/uploads/2015/10/mopb17.jpg?w=625
    Εδώ τελειώνει η βασική εγκατάσταση & παραμετροποίηση Puppet Master & 2 Slaves
     
    source: http://www.e-apostolidis.gr/%CE%B5%CE%BB%CE%BB%CE%B7%CE%BD%CE%B9%CE%BA%CE%AC/puppet-on-azure-step2-open-source-puppet-setup/
  8. proximagr
    Επειδή η τεχνολογία είναι ένα ποτάμι που ποτέ δεν σταματάει… και το μικρόβιό μας δεν έχει θεραπεία, ο Παντελής Αποστολίδης (IT Pro) από την Office Line και ο Μάνος Πέπης (DEV) από την Innovative Ideas με αρκετά χρόνια εμπειρίας στην αγορά και αρκετές πιστοποιήσεις σε τεχνολογίες Microsoft, Cisco, Azure, κλπ. σκεφτήκαμε να μοιραστούμε ένα οδηγό για DevOps στο Azure! Παρουσιάζοντας το Puppet, το πώς στήνετε στο Azure καθώς και μερικές από τις δυνατότητές του.
    Έτσι το Lab μας στο Azure έτρεχε με 1000 και το αποτέλεσμα παρακάτω…
     
    Τι είναι το Puppet και πως μπορούμε να το εκμεταλλευτούμε στο Azure
     
    Αυτοματοποιούμε τις διαδικασίες. Κινούμαστε γρήγορα. Αυξάνουμε της αξιοπιστίας και την ασφάλεια.
    Ο όγκος και η πολυπλοκότητα των υποδομών σε μια δομημένη μηχανογραφημένη εταιρεία ολοένα και αυξάνετε και γίνεται ποιο “smart”. Οι απαιτήσεις για ταχύτητα, αξιοπιστία, σταθερότητα, ασφάλεια ολοένα και αυξάνονται.
    Πώς μπορούμε να επιτύχουμε αυτή την ισορροπία; Σκοπός μας είναι να κάνουμε περισσότερα σε λιγότερο χρόνο! Και αυτό μπορούμε να το επιτύχουμε με DevOps…
    Η Υποδομή του Microsoft Azure προσφέρει ότι ακριβώς χρειαζόμαστε για να χτίσουμε όσα απαιτεί η επιχείρησή μας. Παρακάτω θα δούμε πως μπορούμε να ελέγχουμε και να κάνουμε Manage την υποδομή μας στο Azure με την χρήση του Puppet.
    To Puppet είναι μια Cross Platform ανοιχτού κώδικα (Open Source) που υποστηρίζει λειτουργικά Linux (CentOS, Debian, Fedora, Mandriva, Oracle Linux, RHEL, Scientific Linux, SUSE and Ubuntu), όπως επίσης multiple Unix systems (Solaris, BSD, Mac OS X, AIX, HP-UX), Mac OS X, καθώς και τα λειτουργικά της Microsoft.
    To Puppet αποτελείται από τα παρακάτω:


    1) Puppet Master – Ο κεντρικός server όπου διαχειρίζεται τα Puppet nodes (agents)
    2) Puppet Agent - o client που τρέχει στα managed Puppet nodes και επικοινωνεί – συγχρονίζει με τον Puppet master
    3) Foreman - ένα web περιβάλουν που απεικονίζει τα reports και ελέγχει τα resources της υποδομής μας  

    Προετοιμασία Azure Βήμα 1 Azure network
    Δημιουργούμε ένα Virtual Network. Αυτό μας δίνει τρία πλεονεκτήματα, ένα είναι το isolation, δεύτερον είναι οι Local στατικές IP και τρίτον είναι η δυνατότητα για Site-2-Site & Point-2-Site VPN.
    Για να δημιουργήσουμε ένα Virtual network, από το Azure Management Portal πατάμε New, διαλέγουμε Networking, Virtual Network, δίνουμε όνομα, Location και πατάμε create a virtual network

    Βήμα 2 Azure Cloud service
    Δημιουργούμε ένα Cloud Service, από το Azure Management Portal πατάμε New, διαλέγουμε Compute, Cloud Service και πατάμε Quick Create

     
    Δίνουμε όνομα στο URL και διαλέγουμε το Region ίδιο με του Virtual Network
     
    Βήμα 3 Azure Storage account
    Δημιουργούμε ένα Storage account, από το Azure Management portal πατάμε New, Storage και πατάμε Quick Create
    Δίνουμε όνομα, στην συγκεκριμένη περίπτωση openpuppetlab, διαλέγουμε το location που είναι και το Virtual Network, τέλος διαλέγουμε redundancy και πατάμε Create Storage Account .

    Βήμα 4 Azure VM | Puppet Master
    Δημιουργούμε ένα Virtual Machine, από το Azure Management Portal πάμε στα Virtual Machines και πατάμε New
    Και πατάμε «From Gallery”

    Για το Puppet 3.8 διαλέγουμε το Ubuntu Server 14.04 LTS και πατάμε το βελάκι δεξιά

    Δίνουμε όνομα, για Size ένας Puppet Muster θέλει τουλάχιστον ένα A2 (2 cores, 3.5 GB memory), δίνουμε username και επιλέγουμε το πεδίο “Provide a password” και δίνουμε password και πατάμε το βελάκι δεξιά

    Στην επόμενη εικόνα διαλέγουμε το cloud service, το Virtual Network Που δημιουργήσαμε στο Βήμα 1 (στο πεδίο Region/Affinity group/Virtual network) και το storage account που δημιουργήσαμε στα προηγούμενα βήματα. Στο Endpoint αλλάζουμε την Public πόρτα του SSH, για λόγους ασφάλειας, και πατάμε το βελάκι δεξιά
     

    Στην επόμενη εικόνα πατάμε το check για να δημιουργηθεί το VM.
    Βήμα 5 Στατική IP
    Για να δώσουμε στατική IP πρέπει να μεταβούμε στο νέο Azure Portal
    Πηγαίνουμε στο “Virtual Machines (classic)” και επιλέγουμε το VM

    Στην καρτέλα Settings πατάμε IP Addresses

    αλλάζουμε το IP address assignment κάτω από το Private IP address σε Static, δίνουμε την στατική IP που θέλουμε και πατάμε save

    Βήμα 5 Azure VM | Puppet Slaves
     
    Για τις ανάγκες του Lab θα δημιουργήσουμε δύο ακόμα Ubuntu Server 14.04 LTS αλλά θα χρησιμοποιήσουμε μικρότερου μεγέθους Virtual Machine.
    Ακολουθούμε την ίδια διαδικασία όπως στο βήμα 4 μόνο που στην οθόνη 2 του “Virtual machine configuration” δίνουμε όνομα “ puppetslave01” και διαλέγουμε ένα A0 (shared core, 768 memory)
     
    http://www.e-apostolidis.gr/wp-content/uploads/2015/10/mop11.jpg
     
    Στην επόμενη οθόνη, δίνουμε τα ίδια για cloud service, virtual network & storage account, αλλά στο Endpoint πρέπει να δώσουμε διαφορετικό Public Port διότι η εξωτερική IP είναι ίδια. Για το lab δίνουμε την πόρτα 30022
     
    http://www.e-apostolidis.gr/wp-content/uploads/2015/10/mop07.jpg
     
    Κάνουμε την ίδια διαδικασία και για να φτιάξουμε και δεύτερο Puppet Slave, αλλάζοντας μόνο το όνομα και το Public Port. Για το Lab έφτιαξα το puppetslave02 με πόρτα 30023
    Αφού δημιουργηθούν τα VMs ακολουθούμε το Βήμα 5 για να δώσουμε στατικές IP, στο Lab έδωσα 10.0.0.5 & 10.0.0.6 αντίστοιχα
     
    SOURCE: http://www.e-apostolidis.gr/%CE%B5%CE%BB%CE%BB%CE%B7%CE%BD%CE%B9%CE%BA%CE%AC/puppet-on-azure-step1-azure-preparation/
  9. proximagr
    Free e-book: Azure Strategy and Implementation Guide
    Microsoft Azure is giving free a Strategy and Implementation guide for Azure. This e-book provides guidance, architecture and advises to implement and integrate cloud technologies.
    This guide is directed to system administrators, cloud architects and project managers. It has for chapters, the Governance, the Architecture, the Application development and operations and the Service management.
    It will help you for starting with Azure or just doing a research regarding any cloud implementations.
    You can download your free copy from this link: https://azure.microsoft.com/en-us/resources/azure-strategy-and-implementation-guide/en-us/
  10. proximagr
    Azure Blob Storage… Recycle Bin!!!!!!!
    Remember all that red alerts when comes to deleting blobs? Ah, forget them! Microsoft Azure brought the Windows Recycle Bin to Azure and named it Soft delete.
    The soft delete feature basically is similar to the Windows recycle bin. Deleting a file from the Windows explorer, the Operating System instead of actually removing the file it moves it to the recycle bin. The file stays there and it can be undeleted at any time. The soft delete feature in Microsoft Azure does the same thing for blob storage. When data is deleted or overwritten, the data is not actually gone. Instead, the data is soft deleted, thereby making it recoverable if necessary.
    It’s not enabled by default, but it’s very easy to enable it. Go to the Storage Account, scroll down to the Blob Service and select “Soft delete”. Select the Retention policy and Save, that’s all!

    Let’s delete and test. Browse a container and click the “Show delete blobs”. The current blob will show as active.

    deleting the blob it will change the status to “deleted”

    Click the three little dots and you can undelete, the blob, in Azure!!!

    Active again!

    Be careful, if you delete the whole container, the storage account or the Azure Subscription there is no return. The Soft delete feature is at blob level inside a container.
    For more deltails visit the docs: https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-soft-delete
    [/url]
    The post Azure Blob Storage… Recycle Bin!!!!!!! appeared first on Apostolidis IT Corner.


    Source
  11. proximagr
    Get early access to large disks support of Azure Backup & more
    Azure Backup’s 1TB limitation at last is over! Now you can backup VMs with disk sizes up to 4TB(4095GB), both managed and unmanaged. Also has improvements on backup and recovery performance that you can find here.
    Starting today login to the Portal, go to your Recovery Services vault and you will a notification saying “Support for >1TB disk VMs and improvements to backup and restore speed ->”

    Click the notification and the “Upgrade to new VM Backup stack” will open. Here click “Upgrade” to complete the upgrade.

    You can also upgrade all the Recovery Services vaults of a subscription using Azure PowerShell
    1. Select the subscription:
     



    1



    Get-AzureRmSubscription –SubscriptionName "SubscriptionName" | Select-AzureRmSubscription
    2. Register this subscription for the upgrade:
     



    1



    Register-AzureRmProviderFeature -FeatureName "InstantBackupandRecovery" –ProviderNamespace Microsoft.RecoveryServic
  12. proximagr
    Azure App Service, get data from on-premises databases securely
    There are many scenarios where we want to have the Web Application on the Cloud but on the other hand, due to various limitations, the database stays on-premises. Azure has a service, called Azure Hybrid Connections, that allows the Web App to connect to on-premises databases, using internal IP address or the database server host name, without a complex VPN setup.
    The Connection diagram

    I have tested the connection with Microsoft SQL, PostgreSQL, MySQL, mongodb and Oracle. The databse requirements is to have a static port. So the first step in case of a Microsoft SQL instance is to assign a static port. In my test environment I have a Microsoft SQL 2016 and I assigned the default port 1433, using the Sql Server Configuration Manager / SQL Server Network Configuration / Protocols for INSTANCENAME (MSSQLSERVER)

    All paid service plans supports hybrid connections. The limits are on how many hybrid connections can be used per plan, as the below table shows.Pricing planNumber of Hybrid Connections usable in the planBasic5Standard25Premium200Isolated200
    To start creating the Hybrid Connections, go to the App Service / Networking / Hybrid Connections and press the “Configure your hybrid connection endpoints”

    At the Hybrid connections blade there are two steps, the first is to “Add hybrid connection” and the second is to “Download the connection manager”.

    First click the “Add hybrid connection” and then press “Create new hybrid connection”

    The “Create new hybrid connection” blade will open. Add a Hybrid connection name, this must be at least 6 characters and it is the display name of the connection. At the Endpoint host add the hostname of the database server and at the Endpoint port, the port of the database. At my case I added 1433, as this is the port I assign to my SQL instance before.
    Finally you will need to specify a name for a Servicebus namespace. As you realize, the hybrid connection uses Azure Servicebus for the communication, and press OK.

    Once the connection is created it will be shown at the portal as “Not connected”

    Now we need to download and install the hybrid connection manager by clicking the “Download connection manager”. For this test I will install the hybrid connection manager at the same server as the SQL database, but for a production environment it is recommended to install the hybrid connection manager to a different server that will have access to the database servers only to the required ports. For the best security install it to a DMZ server and open only the required ports to the database servers.
    Run the downloaded msi and just click Install.

    Open the “Hybrid connection manager” UI and press “Add a new Hybrid Connection.

    Sign in to your Azure account

    Once logged in, choose your Subscription and the hybrid connection configured previously will appear. Select it and press Save.

    Now at the connection manager status it will show “Connnected”

    The same at the Azure Portal and your Hybrid connection is ready.

    Test, test, test and proof of concept. Open the Console, form the Wep App Blade, and tcpping the SQL server’s hostname atthe port 1433

    and also sqlcmd

    [/url]
    The post Azure App Service, get data from on-premises databases securely appeared first on Apostolidis IT Corner.


    Source
  13. proximagr
    Puppet On Azure Επειδή η τεχνολογία είναι ένα ποτάμι που ποτέ δεν σταματάει… και το μικρόβιο μας δεν έχει θεραπεία, ο Παντελής Αποστολίδης (IT Pro) από την Office Line και ο Μάνος Πέπης (DEV) από την Innovative Ideas με αρκετά χρόνια εμπειρίας στην αγορά και αρκετές πιστοποιήσεις σε τεχνολογίες Microsoft, Cisco, Azure, κλπ. σκεφτήκαμε να […]
    The post Puppet On Azure | Βήμα 1, Προετοιμασία Azure appeared first on Proxima's IT Corner.


    Source
  14. proximagr
    SQL Failover Cluster with AlwaysOn Availability Groups
     
    Πάμε τώρα για το τελευταίο κομμάτι του lab, να προσθέσουμε AlwaysOn Availability Group στο υπάρχον SQL WSFC.
    Windows Server 2012 R2 Failover Cluster with FreeNAS 9.3 (Page 1, Page 2) Microsoft SQL 2012 on Failover Cluster (Page 1, Page 2, Page 3) Add AlwaysOn AG to SQL Failover Cluster Instance (Page 1, Page 2, Page 3)

    Add AlwaysOn AG to SQL Failover Cluster Instance (Page 3)
     

    Στην καρτέλα validation αγνοούμε το warning για τον Listener, θα τον δημιουργήσουμε μετά

    Και πατάμε Finish για να δημιουργήσει το Group

    Σε αυτό το σημείο μπορούμε να δημιουργήσουμε Listener. Σε μια εγκατάσταση που όλα τα SQL Instances είναι single ένας Listener χρησιμεύει για common name, ώστε να οδηγεί κάθε φορά τις εφαρμογές στο σωστό server. Στην περίπτωση όμως που το ένα ή περισσότερα instances είναι clustered δεν λειτουργεί ο Listener. Μπορούμε και πάλι να δημιουργήσουμε τον Listener αλλά σε περίπτωση που χαθούν τα δύο πρώτα και βασικά Nodes του Cluster τότε ο μόνος τρόπος για να γίνει access η SQL είναι με το instance name του τρίτου Node, στην περίπτωση του lab είναι Win2012R203\MSSQLAG.
    Εδώ πρέπει να τονίσουμε ότι εφόσον δεν υπάρχει Listener και Automatic Failover για να γίνει access η SQL σε περίπτωση που χάσουμε το SQL Failover Cluster Instance πρέπει να γίνει Manual Failover στο Availability Group μέσο του SQL Management Studio, όπως είπαμε και κατά τη δημιουργία.
    Τέλος να πούμε ότι η διαχείριση του Failover Cluster SQL Instance γίνετε μέσω του Windows Server Failover Cluster Manager, όπως π.χ. το manual failover, όπως είδαμε και στο προηγούμενο post. Ενώ η διαχείριση του AlwaysOn High Availability γίνετε από το SQL Management Studio.
     
    Πηγή http://www.e-apostolidis.gr/%ce%b5%ce%bb%ce%bb%ce%b7%ce%bd%ce%b9%ce%ba%ce%ac/add-alwayson-ag-to-sql-failover-cluster-instance/
  15. proximagr
    SQL Failover Cluster with AlwaysOn Availability Groups Η ιδέα είναι να έχουμε ένα SQL Flailover Cluster στο Primary Site και στο υπάρχον Cluster να προσθέσουμε ένα AlwaysOn Availability group για το DR. Λόγο του μεγέθους της υλοποίησης θα γίνει τρία Posts. Ένα το Failover Cluster, ένα η εγκατάσταση της SQL σε Failover Clster και ένα η υλοποίηση του […]
    The post SQL Failover Cluster with AlwaysOn Availability Groups appeared first on Proxima's IT Corner.


    Source
  16. proximagr
    A simple way to test if the Exchange server is processing emails is by using telnet & SMTP commands. First open a telnet client. The simplest is to open a Command Prompt and type: “telnet yourexchangeserver 25” and press Enter The Command Prompt will start the telnet client and try to connect to the mail […]
    The post Test Exchange mail submission using SMTP commands appeared first on Proxima's IT Corner.


    Source
  17. proximagr
    Αυτό δεν είναι ένα από τα συνηθισμένα μου posts. Απλά θέλω να μοιραστώ την εμπειρία της καθαρής εγκατάστασης του Exchange 2016 για όποιον θέλει να δημιουργήσει ένα lab και να εξασκηθεί. Για το δικό μου lab χρησιμοποίησα έναν Windows Server 16 TP3, ο οποίος είναι Domain Controller & DNS στο Domain mylab.lab Η εγκατάσταση του […]
    The post Microsoft Exchange 2016 | Από το 0 στο 1ο email appeared first on Proxima's IT Corner.


    Source
  18. proximagr
    Puppet On Azure Εγκατάσταση & Παραμετροποίηση του FOREMAN για να έχουμε γραφικό περιβάλλον μέσω WEB Το Open Puppet δεν έχει γραφικό περιβάλλον στην βασική του εγκατάσταση. Υπάρχουν μερικά open source προγράμματα τα οποία μπορούν να προτεθούν στο Puppet Master και να μας προσφέρουν γραφικό περιβάλλον. Ένα από τα καλύτερα είναι το Foreman. Με το Foreman […]
    The post Puppet On Azure | Βήμα 5, FOREMAN appeared first on Proxima's IT Corner.


    Source
  19. proximagr
    Puppet On Azure Puppet Automation – Δημιουργία αρχείου στους Servers που κάνουμε Manage Έχουμε εγκαταστήσει το Puppet και τους Agents, τώρα είναι η ώρα να δούμε ένα test automation. Παράδειγμα «Δημιουργία αρχείου» Στον Puppet Master τρέχουμε: nano /etc/puppet/manifests/site.pp και δίνουμε όνομα του αρχείου και το path το security “mode” και το περιεχόμενο του αρχείου ”content” […]
    The post Puppet On Azure | Βήμα 4, Puppet Automation appeared first on Proxima's IT Corner.


    Source
  20. proximagr
    Puppet On Azure Προσθήκη Windows Agent Βήμα 1 Δημιουργία Windows VM Δημιουργούμε ένα Virtual Machine, από το Azure Management Portal πάμε στα Virtual Machines, πατάμε New και πατάμε «From Gallery” Διαλέγουμε Windows Server 2012 R2 Datacenter Δίνουμε όνομα, για το Lab: “puppetslave03”, size ένα A0, username & password Στην επόμενη οθόνη επιλέγουμε το ίδιο Cloud […]
    The post Puppet On Azure | Βήμα 3, Προσθήκη Windows Agent appeared first on Proxima's IT Corner.


    Source
  21. proximagr
    Puppet On Azure Εγκατάσταση Open Source Puppet Βήμα 1 Σύνδεση στο Ubuntu ανοίγουμε έναν SSH client, στην προκειμένη περίπτωση PuTTY και δίνουμε για Host Name το Public όνομα του Cloud Service, στην προκειμένη περίπτωση openpuppetlab.cloudapp.net, δίνουμε την πόρτα 30021 που έχουμε ορίσει για το puppetmaster και πατάμε Open Κάνουμε login με το username & password […]
    The post Puppet On Azure | Βήμα 2, Εγκατάσταση Open Source Puppet appeared first on Proxima's IT Corner.


    Source
  22. proximagr
    SQL Failover Cluster with AlwaysOn Availability Groups
     
    Αυτό είναι το δεύτερο Post της τριλογίας SQL Failover Cluster with AlwaysOn Availability Groups. Είναι η ώρα της SQL.
    Windows Server 2012 R2 Failover Cluster with FreeNAS 9.3 (Page 1, Page 2) Microsoft SQL 2012 on Failover Cluster (Page 1, Page 2, Page 3) Add AlwaysOn AG to SQL Failover Cluster Instance (Page 1, Page 2, Page 3)

    Microsoft SQL 2012 on Failover Cluster (Page 2)
     

    Και έχουμε έναν διαθέσιμο δίσκο στο Cluster μας

    Πίσω τώρα στο SQL Setup, κάνουμε refresh και αυτόματα επιλέγει τον νέο δίσκο

    Στη συνέχεια δίνουμε στατική IP στο SQL Cluster Network, φυσικά από το Domain subnet

    Δίνουμε service accounts, για το Lab όπως είπα χρησιμοποιώ τον Domain Admin, αλλά ποτέ σε production.

    Στο Server Configuration δίνουμε ποιοι θα έχουν admin rights στην SQL

    Και στο Data Directories tab βλέπουμε ότι ήδη έχει επιλέξει το SQL Cluster Disk. Σε παραγωγικό περιβάλλον φυσικά θα έχουμε περισσότερους δίσκους για κάθε βάση/log.

    Μετά φτάνομε στο ready to install και πατάμε install. Περιμένουμε να γίνει η εγκατάσταση αργά και βασανιστικά μέχρι να δούμε το υπέροχο Completed successful.

    Και αν πάμε στο Failover Cluster Manager στους ρόλους θα δούμε το SQL Server

    Εδώ τελειώνει η εγκατάσταση του πρώτου Node. Κάνουμε Mount το ISO της SQL στο δεύτερο node και ξεκινάμε το Setup. Επιλέγουμε Add node to a SQL Server failover cluster

    Για το lab επιλέγω πάλι Evaluation, κάνω accept policies κλπ και πάμε για το installation.
    Στο Cluster Node Configuration ελέγχουμε ότι έχει βρει το SQL cluster που δημιουργήσαμε και πατάμε Next

     
    Συνέχεια στην επόμενη σελίδα
     
    Πηγή http://www.e-apostolidis.gr/%ce%b5%ce%bb%ce%bb%ce%b7%ce%bd%ce%b9%ce%ba%ce%ac/microsoft-sql-2012-on-failover-cluster/
  23. proximagr
    Create Azure File Shares at your ARM template using PowerShell
    Using Azure Resource Manage template deployment, you can create a Storage account but you cannot create File Shares. Azure File Shares can be created using the Azure Portal, the Azure PowerShell or the Azure Cli.
    Mainly, the idea is to run a PowerShell script that will create the File Shares. This script will be invoked inside the ARM Template. In order to use a PowerShell script from a template, the script must be called from a URL. A good way to provide this is using the Git repository. One major thing to consider is the Storage Account key must be provided to the PowerShell script securely, since the PowerShell script is at a public URL.
    The PowerShell script will run inside a Virtual Machine and we will use a CustomScriptExtension Extension to provide it. To use this, at the Virtual Machine Resource of the JSON file add a resources section.
    The Custom Script Exception is located at the Virtual Machine resource. Lets assume that the last part of the Virtual Machine resource is the “diagnosticsProfile” so after the closure of the “diagnosticsProfile” we can add the “resources”. Inside the “resources” add the “extensions” resource that will add the “CustomScriptExtension”, like below.The Template Part
    This will be the addition at the Virtual Machine resource:
    "diagnosticsProfile": { "bootDiagnostics": { "enabled": true, "storageUri": "[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('diagnosticStorageAccountName')), '2016-01-01').primaryEndpoints.blob)]" } } }, "resources": [ { "name": "AzureFileShares", "type": "extensions", "location": "[variables('location')]", "apiVersion": "2016-03-30", "dependsOn": [ "[resourceId('Microsoft.Compute/virtualMachines', parameters('VMName'))]", "[variables('AzureFilesStorageId')]" ], "tags": { "displayName": "AzureFileShares" }, "properties": { "publisher": "Microsoft.Compute", "type": "CustomScriptExtension", "typeHandlerVersion": "1.4", "autoUpgradeMinorVersion": true, "settings": { "fileUris": [ "https://raw.githubusercontent.com/######/#####/master/azurefiles.ps1" ] }, "protectedSettings": { "commandToExecute": "[concat('powershell -ExecutionPolicy Unrestricted -File ','azurefiles.ps1 -SAName ',parameters('AzureFilesStorageName'),' -SAKey ', listKeys(resourceId(variables('AzureFilesStorageAccountResourceGroup'),'Microsoft.Storage/storageAccounts', parameters('AzureFilesStorageName')), '2015-06-15').key1)]" } } } ] },
    The extension must be depended from the Virtual Machine that will run the script and the Storage Account that will bu used for the file shares.
    At the custom script properties add the public RAW url of the PowerShell script.
    Next lets see the Storage Account key and execution part. At the connandToExecute section, we will provide a variable that will pass the Storage Account key & Name inside the script for execution. The variable will get the Storage Account key from the Storage Account using the permissions of the Account running the Template Deployment.
    Of course to make the template more flexible I have added a variable for the Resource Group and a parameter for the AzureFilesStorageName, so the template will ask for the Storage Account name at the parameters.The PowerShell
    The PowerShell script is tested at Windows Server 2016 VM. You can find it below:
    Param ( [Parameter()] [String]$SAKey, [String]$SAName)Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -ForceSet-PSRepository -Name PSGallery -InstallationPolicy TrustedInstall-Module Azure -Confirm:$FalseImport-Module Azure$storageContext = New-AzureStorageContext -StorageAccountName $SAName -StorageAccountKey $SourceSAKey$storageContext | New-AzureStorageShare -Name #####
    [/url]
    The post Create Azure File Shares at your ARM template using PowerShell appeared first on Apostolidis IT Corner.


    Source
  24. proximagr
    Azure File Sync & DFS Namespace
    Azure File Sync is a new Azure feature, still in preview, that allows to sync a folder between your local file server and Azure Files. This way your files are accessible both locally at your file server and publicly at Azure Files using an SMB 3.0 client. Also the files can be protected online using Azure Backup.
    The idea of this post is to have the files of two file servers to sync to Azure Files using Azure File Sync and in addition use the DFS Namespace feature to achieve common name and availability. This is not something officially supported, it is just an idea on using two different technologies to help for a service.
    The requirement before starting the Azure File Sync is to create an Azure File share. We have covered this at a previews post, check here
    Once the Azure Files share is ready, proceed with the Azure File Sync resource. At the Azure Portal press New and search for it and create it.

    At the Deploy Storage Sync blade select a name for the Resource, subscription, resource group and location.

    When the Azure File Sync is ready we need to create a Sync group. Sync group is something like the DFS Replication Group. It is a group that consists of an Azure File Share and many local file servers that syncs a folder.

    Press “+Sync group” it will open the new “Sync group” blade. There provide a name for the Sync group and select the storage account and the Azure File Share created before.

    The Sharegroup is ready with the cloud endpoint. The next step is to add the first local file server. Register the local servers
    Navigate to https://docs.microsoft.com/en-us/azure/storage/files/storage-sync-files-server-registrationfor information on how to download the agent, install it and register the server. After that press “Add server endpoint”

    At the “Add server endpoint” blade, select the registered server and add the path to the folder that has the data you want to sync. With Cloud Tiering you select a percent of the volume of the local server. When the capacity of the volume reaches this number then Azure File Share makes the files that are less frequently accessed cloud only. The file icon on the server get transparent and if anyone double clicks the file then it is downloaded instantly.

    Register the second server the same way as the first and finally the share group will have two server endpoints. At my example the second server had no data, just the folder, and the Azure File Sync synced all files from server A.
    Create a DFS Namespace
    The next step is to create a DFS Namespace, just the namespace with the two local servers. Add the folders of both servers and you are ready.

    Also if you browse the Azure File Share, all files are accessible

    Notes from the field
    Adding or changing a file at the first server, almost instantly replicates to Azure File Share and to the second server.
    Altering a file at both servers instantly it will keep the last accessed by timestamp as is and the other file will be renamed by adding the server name at the file name, as the example “enaneoarxeio-AzureFS2.txt” where AzureFS2 is the server name.
    You can add an Azure Backup and have a Cloud Backup of all your files.
  25. proximagr
    Protect your Web App using Azure Application Gateway Web Application Firewall
    Web Application Firewall was always a big investment for a small or growing company as most of the top branded companies are charging a lot of money A Web Application Firewall protects your application from common web vulnerabilities and exploits like SQL Injection or Cross site scripting. Azure provides enterprise grade Web Application Firewall through the Application Gateway. It comes in two pricing models, Medium and Large. More about sizes and instances you can find here, and more about pricing here
    We can add the Application Gateway Web Application Firewall to protect our Azure Web App (PaaS) and our Web Application inside a VMs web server (IaaS). At this post we will see how to protect them both.

    One difference in order to fully protect the Azure Web App (PaaS) is to create an App Service Environment with internal VIP to host the Web App in order to hide it inside a VNET. First things first, create a VNET with one subnet for the Application Gateway WAF.App Service Environment
    After the VNET create the App Service Environment, from the Azure Portal, New –> App Service Environment and select VIP Type “Internal”. Add it to the VNET created before and create a subnet for the ASE. You need to be patient here because the deploy will take more than an hour, almost two.
    Web App
    As soon as the App Service Environment is ready we can create our Web App. Create a Web App from Azure Portal with one difference, on the App Service Plan location instead of selecting a Region select he App Service Environment.

    As you realize, the Web App resides at the internal VNET with no access from the internet. So, in order to access the application at this point we need a VM ( a small one just to test and deploy our application ). Create a small VM and add it to this VNET. One small detail, in order to be able to browse to the site’s URL we need to enter the FQDN, in our case papwaf3app.funniest.gr. In order to do this we need an entry at the VM’s host file. This way we can access the new born Web App.
    Web Application Firewall
    Lets create the Secure public entry point for our Web App. Create an application gateway, select WAF Tier, select the required SKU, add it to the WAF subnet we created before, select Public IP configuration and WAF enabled.


    When the Application gateway is ready we need to do some configuration. First at the Backend pools, open the default created backend pool add the Internal Load Balancer IP address of the ASE as target.

    Then add a health probe. For host add the FQDN of the Web App.

    at the HTTP settings check the “Use custom probe” and select the previously created probe.

    And that’s all. Now we can try our Web App from the Internet. In order to do so we need to browse to the Web App’s URL, that is now published by the Application Gateway, from the Internet. So, we need to create a Public DNS record to point the FQDN to the Application Gateway’s FQDN. In this case we need to crate a CNAME papwaf3app.funniest.gr to point to the 8b0510c1-47e9-4b94-a0ff-af92e4455840.cloudapp.net. In order to test the app right now we can just add a host file to our computer pointing to the Public IP Address of the application gateway and we can access the Web App behind the WAF.

    Logging
    In order to be able to see the Application Gateway and Web Application Firewall logs we need to turn on diagnostics. The easiest way to see the logs is by sending them to Log Analytics (OMS).



    With the Firewall at “Detection” mode, if we try an SQL Injection (?id=10||UTL_INADDR.GET_HOST_NAME( (SELECT user FROM DUAL) )–), the Web App still servers the landing page.

    By switching the Firewall to “Prevention” mode, the same SQL injection attach stops by the WAF before accessing our Web App.
    Protect an IaaS Web Application
    To add a Web Application that runs inside a VM behind the Application Gateway Web Application Firewall, first add the VM as a Back End Pool. Create a new Backend Pool and select “Virtual Machine”. Select the Virtual Machine that runs the Web Application.

    Then create a new probe adding the URL of the Web Application
    next add HTTP settings and add custom probe the new created probe “vmsite”

    Next step is to create two multi-site listeners, one for each host name

    After the listener, add a Basic rule using the Listener, Backend Pool and HTTP settings we created for the VM Web Application,

    Finally one extra step is to change the default rule1 to listen to the WeB App listener

    Finally the Application Gateway Web Application Firewall provides secure access to both the Web App (PaaS) and the VM Web Application (IaaS)

    [/url]
    The post Protect your Web App using Azure Application Gateway Web Application Firewall appeared first on Apostolidis IT Corner.


    Source
×
×
  • Create New...